Java Program:

- To take users input & print

Example:

User Input: 12

Output: 12

import java.util.Scanner;
public class InputProgram {
  public static void main(String []args) {
    int num;
    System.out.print("Enter a number : ");
    Scanner userInput = new Scanner(System.in);
    num = userInput.nextInt();
    System.out.println("You entered : "+ num);
  }
}

Output:

  Enter a number : 121
  You entered : 121
Program
basic
Scanner userInput = new Scanner(System.in);
num = userInput.nextInt(); //to take user input & convert it into integer
System.out.println("You entered : "+ num); //to print variable

Syntax to take any DataType input value :
scannerObjectName.nextDataType()

To take input, use Scanner object to store your input inside a variable and

Must import java.util.Scanner

Concept

Coming Soon !

Quick
Tutorial

Quote

A good decision is based on knowledge and not on numbers.