Scanner has been used with the standard input stream:
Scanner scan = new Scanner( System.in );
By using input redirection, the standard input stream has sometimes come from a disk file.
Recall, from chapter 10, that input and output are done with streams of data. There is a standard input stream, a standard output stream, and a standard error stream.
Scanner object constructed with
scans the standard input stream for groups of characters.
Some of its methods convert a group characters to a specific data type.
nextInt() method reads in a group of characters that
can be converted to an
Could the characters of an input stream come from a disk file?