I have program where there's text that's being printed. I want to know how I can make it so that the text wait's with printing until I press enter. Thanks in advance.
Asked
Active
Viewed 32 times
0
-
please go through https://stackoverflow.com/questions/17538182/getting-keyboard-input – ABI Nov 17 '17 at 13:40
1 Answers
1
At the top of the program, create a Scanner
with System.in
as its source:
Scanner scan = new Scanner(System.in);
Whenever you want to pause:
System.out.println("Press ENTER to continue..."); // optional
scan.nextLine();

Kevin Anderson
- 4,568
- 3
- 13
- 21