Input

Input

import java.util.Scanner;

class Input {
    public static void main(String[] args) {
    	
    	Scanner input = new Scanner(System.in);
    	
    	System.out.print("Enter an integer: ");
    	int number = input.nextInt();
    	System.out.println("You entered " + number);
    }
}

There are several ways to get input from the user in Java. One of them is input by using Scanner object.

Input — Structure map

Clickable & Draggable!

Input — Related pages: