SyntaxFix
Write A Post
Hire A Developer
Questions
Your condition is right (though you should drop the == true). What is happening is that the scanner will keep going until it reaches the end of the input. Try Ctrl+D, or pipe the input from a file (java myclass < input.txt).
== true
java myclass < input.txt