posted 13 years ago
I am trying to run this following code using scanner to obtain the tokens:
However when i am taking the input from the console using the Scanner, the while loop correctly parses the tokens, but then it keeps on looping in endless loop, and the program execution does not stop.
If i change the Scanner object to take the input from command line i.e
The while loop correctly terminates after parsing out the tokens.
can you please explain why the while loop does not terminate when i am taking input from the user, and is there a way to make the while loop correctly terminate while doing the same
If debugging is the process of removing bugs, then programming must be the process of putting them in. -- Edsger Dijkstra