In extends java.lang.Object Simple input from the keyboard or from a file. This class allows reading formatted data either from the keyboard or from a file. It is intended to be used in an introductory programming course when classes, packages and exceptions are unknown at the beginning. To use it, simply copy In.class into the source file directory.
All input comes from the current input file, which is initially the keyboard.
When reading from the keyboard, reading blocks until the user has entered a sequence of characters terminated by the return key. When a method tries to read beyond the end of the buffer, it blocks again waiting for the next buffer. When reading from a file, eof occurs when an attempt is made to read beyond the end of the file. Open a text file for reading The text file with the name fn is opened as the new current input file. Peek at the next character.