SyntaxFix
Write A Post
Hire A Developer
Questions
Scanner has a method called hasNext():
Scanner scanner = new Scanner(System.in); while(scanner.hasNext()) { System.out.println(scanner.nextInt()); }