Java Program to Read Data from User Using Scanner class

Write a Java program to read data from user using scanner class.

Source Code
import java.util.Scanner;

class ReadDataUsingScanner {

	public static void main(String[] args) {

		Scanner input = new Scanner(;
		System.out.print("Enter the number :: ");
		int num = input.nextInt();
		System.out.println("You entered number " + num);
C:\>java ReadDataUsingScanner
Enter the number :: 9
You entered number 9