Java is very versatile in its ability, but can become even more versatile with the integration of user input. One way to have user input is the Scanner Class. This class allows the programmer to scan the keyboard and get input from the user.
How to Instantiate the Scanner Class
Since it is not built into the regular Java library, it needs to be imported. It can be imported like so:
or
Note: All imports are declared at the top of the program before the main method like so: