SyntaxFix
Write A Post
Hire A Developer
Questions
Here's a minimalist way to do it.
System.out.print("Please enter an integer: "); while(!scan.hasNextInt()) scan.next(); int demoInt = scan.nextInt();