There will be white space after the last character. (Actually, this is not quite good enough. But let us keep things simple.)
The URL extracter looks
for tokens in a stream of
characters from a
BufferedReader
.
The BufferedReader
receives
characters from a
FileReader
which is
connected to the text file input.
The URL extracter will be a scanner.
The main()
program reads tokens from
the scanner and writes them to the
monitor.
The details of character input are not important
for this program. You should be able to read
the following pages without the details.
Essentially, the BufferedReader
object
delivers one character at a time to our Scanner
object.
It would be natural to use the Java Scanner
class for this program.
But that would be an example of using a scanner, not writing one.
Wouldn't it be better for our scanner to directly write its
tokens to the monitor, rather than pass them on
to main()
?