Ã88
Fully Optimized
- Messages
- 4,775
I went back to an old program I was working on and now it won't work at runtime.
The issue starts right at the beginning where I have the statement:
The program pauses here until I hit enter. Now the main issue occurs when the first input request is called which asks for an integer but, as I am assuming it to be, a '\n' is appended to the beginning of the input from when I had to hit enter so now I get an error:
I know it stems from when i have to hit enter. The program never used to pause at this spot before but now suddenly it does. Any ideas?
The issue starts right at the beginning where I have the statement:
Code:
Scanner in = new Scanner(System.in);
The program pauses here until I hit enter. Now the main issue occurs when the first input request is called which asks for an integer but, as I am assuming it to be, a '\n' is appended to the beginning of the input from when I had to hit enter so now I get an error:
Exception in thread "main" java.util.InputMismatchException: "" is not an integer
I know it stems from when i have to hit enter. The program never used to pause at this spot before but now suddenly it does. Any ideas?