A stream of characters is input (from a file) and later a stream of characters is output (often to the same file).
Some programs read the entire input stream is before they write the output stream. Other programs read the input stream item by item and produce one item of output for each item of input. There are many other patterns of input and output.
In general, a program may have several input streams flowing into it and several output streams flowing out of it. For most of the programs in these notes, there are three I/O streams:
Normally System.in
is connected to the keyboard
and the data are characters.
System.out
and System.err
both are connected
to the monitor, and also are character data.
These notes do not use System.err
.
What does the keyboard send to your program when you type the following:
1234