posted 15 years ago
Because of the exception, the done variable remains false for ever. The Scanner continues to look at the token which wasn't a number, so consume that token with a call to in.next(); inside the catch. No need to do anything with that token.
Then you can enter a new token, and the loop can go round once more.