No, probably not. This implementation is intended to show how a scanner is built, not to show an ideal application.
As is often true,
the program could have been written faster and better
using Scanner
and
some String
methods.
Class URL
is likely to be useful.
You might try this as an exercise.
You are at the end this chapter. Scan through the list of topics. To review one of them, click on it to go to the page where it was discussed.
The next chapter continues the discussion of scanners by showing situations where a scanner must "push back" a character after reading it.