wait For Console Input - Java Language Basics

Java examples for Language Basics:Console

Description

wait For Console Input

Demo Code


//package com.java2s;
import java.util.Scanner;

public class Main {
    public static void main(String[] argv) throws Exception {
        waitForInput();/*from   ww w. j  a  va  2 s .c  om*/
    }

    public static void waitForInput() {
        Scanner scanner = new Scanner(System.in);
        scanner.nextLine();
    }
}

Related Tutorials