0

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.

  • please go through https://stackoverflow.com/questions/17538182/getting-keyboard-input – ABI Nov 17 '17 at 13:40

1 Answers1

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,388
  • 2
  • 10
  • 20