You won't always need to input text from the console - it's a less common activity than making a variable or executing a loop. As a result, the Scanner class isn't a default part of Java. It is instead part of the standard library.
A library is a collection of code that anyone can use, but isn’t automatically loaded into every program. To use the scanner, you must first import it. You can import Scanner by typing the following line at the top of your program:
Creating a Scanner
You can get input from the user with the Scanner object. To create a scanner, you’ll use the following line of code:
Scanner input = new Scanner(System.in);
In the above line, we’ve created a Scanner object with the name input.
Later in the course we’ll break down exactly what everything on this line means. For now, know that you can change the name input to anything.