September 2011
Beginner
650 pages
15h 47m
English
1. Why does Java define both byte and character streams?
The byte streams are the original streams defined by Java. They are especially useful for binary I/O, and they support random-access files. The character streams are optimized for Unicode.
2. Even though console input and output is text-based, why does Java still use byte streams for this purpose?
The predefined streams, System.in, System.out, and System.err, were defined before Java added the character streams.
3. Show how to open a file for reading bytes.
Here is one way to open a file for byte input:
![]()
4. Show how to open a file for reading characters.
Here is one ...
Read now
Unlock full access