-
Often a book introduces its own class for keyboard input
in order to avoid these complications.
-
I don't think it is not a good idea for a book
to produce its own class.
-
However, we need not go into the reasons here,
as it's easy to do keyboard input in Java 5.