Take a close look at the while statement and make sure there isn't a statement ending ; before the { that surrounds the code that is supposed to be in the loop.
The while and do-while Statements...
Type: Posts; User: Norm
Take a close look at the while statement and make sure there isn't a statement ending ; before the { that surrounds the code that is supposed to be in the loop.
The while and do-while Statements...
That's two statements. Which one is it hanging on? Put a println between them.
What statement is the one before the last println statement that did not print?
EDIT: corrected above
When it did not print, that means the statement before it is hung.
Try adding some println statements to see where the code is hanging/stuck. Sometime you need them every other statement so you can tell which statement the program is hanging on. If one println...
What does the code print out when it executes?
Does the program end normally?
Add some println statements so you can see where the code is executing and find the last statement that it executed.
What does the code print out when it executes?
Does the program end normally?
Add some println statements so you can see where the code is executing and find the last statement that it executed.