1.2K
Program to print a number, after taking number as a input.
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args) {
// Creates an instance which take input
from standard input
Scanner = new Scanner(System.in);
System.out.print("Enter a number: ");
// nextInt() reads the next integer from the keyboard
int number = reader.nextInt();
// println() prints the following line to the output screen
System.out.println("You entered: " + number);
What You get as Output , After running the program
Enter a number: 10
You entered: 10