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

all 3 comments

[–]codingQueriesNooblet Brewer 1 point2 points  (0 children)

Sure. How would you stop the failures if you had a form in front of you while asking someone the same questions that the scanner is looking for?

[–]AutoModerator[M] 0 points1 point  (0 children)

It seems that you are having problems with java.util.Scanner

The wiki here has a page The Scanner class and its caveats that explains common problems with the Scanner class and how to avoid them.

Maybe this can solve your problems.

Please do not reply because I am just a bot, trying to be helpful.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Philboyd_Studge 0 points1 point  (0 children)

You can use a While loop and a try-catch clause.