This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes please help me with this code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "please help me with this code." Watch "please help me with this code." New topic
Author

please help me with this code.

deepak bhai
Ranch Hand

Joined: Apr 22, 2011
Posts: 33



Find the number of occurrences of given word in a sentence.

why its not working
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4445
    
    5

Please read this: ItDoesntWorkIsUseless (←click)


Junilu - [How to Ask Questions] [How to Answer Questions]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38031
    
  22
Write a sentence on paper, and use a pencil to go through the sentence and count not only how many times the word appears in the sentence, but also the index at which you are inspecting the sentence.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Why are you checking the same condition in the while statement and the if inside the while?


SCJP, SCWCD.
|Asking Good Questions|
deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
Thank you for all the help, The code is fixed. Thank you once again.
 
 
subject: please help me with this code.
 
Similar Threads
Help with english to morse code program, I have no idea what I'm doing
Reading from console
need help counting phrases in a string
GUI Big trouble
Array and GUI