Java Console Prompt promptEnterKey()

Here you can find the source of promptEnterKey()

Description

Pause execution and allow the user to continue by pressing ENTER.

License

Open Source License

Declaration

public static void promptEnterKey() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Scanner;

public class Main {
    private static Scanner scanner = new Scanner(System.in);

    /**/*from w ww. ja  va2 s.c  om*/
     * Pause execution and allow the user to continue by pressing ENTER.
     */
    public static void promptEnterKey() {
        System.out
                .println("An Event has occured! Press \"ENTER\" to continue...");
        scanner.nextLine();
    }
}

Related

  1. prompt(String message)
  2. prompt(String message, String defaults)
  3. prompt(String output)
  4. prompt(String prompt)
  5. promptHidden(String message)
  6. promptPressEnterToExit()
  7. promptRequired(String message)