Java Scanner
We use the Scanner class to take input from users.
To use Scanner, we must add the line
Import java.util.Scanner;
At the beginning of our program.
This imports the Scanner class Inside Our program.
Create Scanner Object:
Once the Scanner class is imported, we need to create an object from it.
Scanner input = new Scanner (System.in);
Here, input is an object of Scanner which will be used to take input. The System. In specifies we will take input from the standard input (keyboard).
Note: We will learn about objects and classes in detail in the upcoming lessons.