A scanner in Java is a command in Java that will read an input for the program. In other words, it scans the input.
The input could be:
- From the user of the program (ex. when someone is playing presses the arrows to move.)
- From another file. The program is linked to another file; the program reads that file.
- From the programmer himself. You could use the scanner to split rows and to get parts of a String.