Readers Writers  «Prev  Next»


Readers Writers - Quiz

Types of Readers and Writers

Each question is worth one point. Select the best answer or answers for each question.
1. Which of the following classes are the best choices for communicating text between two threads?
Please select the best answer.
  A. CharArrayReader and CharArrayWriter
  B. ByteArrayInputStream and ByteArrayOutputStream
  C. StringReader and StringWriter
  D. PipedReader and PipedWriter
  E. PipedInputStream and PipedOutputStream

2. Which of the following statements about the PrintWriter class is true.
Please select the best answer.
  A. PrintStream is a subclass of PrintWriter.
  B. PrintWriter is a subclass of PrintStream.
  C. PrintWriter flushes the output stream every time a newline character is output.
  D. PrintWriter always outputs a single newline character whenever println() is called.
  E. PrintWriter properly handles multi-byte and other non-ISO Latin-1 character sets.

3. When implementing a FilterReader, which method of the superclass will you almost always override?
Please select the best answer.
  A. protected FilterReader(Reader in)
  B. public int read() throws IOException
  C. public int read(char cbuf[], int offset, int length) throws IOException
  D. public boolean markSupported()
  E. public String toString()

Score =
Correct answers: