- #1
mr.hood
- 8
- 0
Hi all,
I've been trying to figure out how I can use the Scanner class in Java to pause my program and wait for the user to hit the return key. What I have now looks like this:
Scanner kbd = new Scanner(System.in);
kbd.next();
...
The thing is, the rest of my program won't run unless there is actually some kind of input (i.e. just hitting the return key without any input just makes the program keep waiting for input). Is there a way I can get around this?
I've been trying to figure out how I can use the Scanner class in Java to pause my program and wait for the user to hit the return key. What I have now looks like this:
Scanner kbd = new Scanner(System.in);
kbd.next();
...
The thing is, the rest of my program won't run unless there is actually some kind of input (i.e. just hitting the return key without any input just makes the program keep waiting for input). Is there a way I can get around this?
Last edited: