Completion requirements
This chapter explains how input and output streams can be used for writing files, similar to how they are used for writing to the display.
7. I/O Class Hierarchy
Answer:
No.
Of course, C++ is an industrial-strength language, so you would be able to write a C++ program that reads the file. But it would be a lot of trouble to do so.
I/O Class Hierarchy
The diagram shows the top of the hierarchy for the java.io
package. The dotted clouds are abstract classes. They act as base classes for specialized streams (to be discussed shortly).
Streams are byte-oriented or character-oriented. Each type has input streams and output streams.
- Byte-oriented streams.
- Intended for general-purpose input and output.
- Data may be primitive data types or raw bytes.
- Character-oriented streams.
- Intended for character data.
- Data is transformed from/to 16 bit Java
char
used inside programs to the UTF format used externally.
In the diagram, abstract classes are drawn as clouds with a dotted border.
Question 7:
Is a
Reader
an input stream or an output stream?