
A Scanner object divides its input into sequences of characters called
tokens, using delimiters. The default delimiters are the standard white-
space characters, which among others include the space, tab, and newline
characters. The complete set of Java whitespace characters is shown in
Table 3.9.
By default, when a Scanner object tokenizes the input, it skips leading
whitespace, then builds a token composed of all subsequent characters
until it encounters another delimiter. Thus, if you have this code,
System.out.print( “Enter your age as an integer > “ );
int age = scan.nextInt( );
and the user types, for example, three spaces and a tab, 21, and a ...