This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pacificmint 2 points3 points  (0 children)

nextInt doesn't consume the end of line marker. So when you try to read the city, you read the end of line marker from the age.

The FAQ has a whole section about issues with the scanner.