title: How to count a frequency of a particular word in a line?
body: <p>I would like to know, that if I am having a single line string, then how to count the frequency of a particular word in that string, using simple java code?!</p>
  
  <p>Thanks in advance..</p>
  
  <hr>
  
  <p>What I am looking for is a sample logical code in java which is used to search a particular word in a sentence. I am building one spam filter, which needs to read the line and then classify it. </p>