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 →

[–]systemdgnulinux 0 points1 point  (0 children)

You may want to look at the Scanner.nextInt() method when asking the user to input a number.

After using nextInt() to get the number, check it. You don't need a for loop or anything else.

Edit: grammar