Press ENTER key to continue - Java Language Basics

Java examples for Language Basics:Console

Description

Press ENTER key to continue

Demo Code


//package com.java2s;
import java.io.Console;

public class Main {
    /** The console. */
    public static Console console = System.console();

    /**// w w  w  . ja  va 2s. c  om
     * Press enter.
     */
    public static void pressENTER() {
        System.out.println("Press ENTER key to continue...");
        console.readLine();
    }
}

Related Tutorials