Java Reference
In-Depth Information
Review Questions
1.
What is the difference between a stream and a reader or writer?
2.
Name the parent class of all input streams.
3.
Which of the following methods is (are) in java.io.OutputStream class? Select all that
apply.
a. public void writeUTF(String string)
b. public void write(int b)
c. public void write(byte [ ] b)
d. public void write(byte [ ] b, int offset, int length)
e. public void close()
4.
Which of the following classes is (are) low-level input streams? Select all that apply.
a. FileInputStream
b. DataInputStream
c. FilterInputStream
d. PushbackInputStream
e. PipedInputStream
5.
True or False: A PipedInputStream can be chained to a FileInputStream.
6.
True or False: A BufferedReader can be chained to a PipedReader.
7.
True or False: A DataInputStream can be chained to a BufferedInputStream.
8.
If you were going to perform I/O that involved working with the eight primitive data
types and String objects, which I/O classes would you likely use?
9.
Suppose that in the previous question the I/O took place between two threads. Which
classes would you use?
10.
If you were going to perform I/O that involved working with characters and String
objects in a file, which I/O classes would you likely use?
11.
If you were going to perform I/O that involved working with Java objects, which I/O
classes would you likely use?
Search WWH ::




Custom Search