Bad example. You want something simpler for the continuation condition. Try reading a
word from the keyboard until the word is STOP. Use
!"STOP".equalsIgnoreCase(word) as your continuation. Prime the loop with
The equalsIgnoreCase method will accept stop StOp Stop STOP etc. to terminate the loop. Remember the bang sign ! for NOT.