Java End-of-file

  • + 1 comment

    If you use the while loop, and the method scanner.hasNext(), as has been mentioned in the problem statement, then you should have no problem in getting all the test cases to pass successfully.