Filter Streams   «Prev  Next»

Java Filter Streams - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 
1. Which of the following is not a method in the PushbackInputStream class?
Please select the best answer.
  A. read()
  B. reset()
  C. close()
  D. toString()
  E. None of the above

2. Besides creating a new instance of a PushbackInputStream, what else is the following line of code doing?
PushbackInputStream pis = new PushbackInputStream(System.in, 432);

Please select the best answer.
  A. Allows the unread() method to "unread" 432 bytes
  B. Allows marking and resetting for this PushbackInputStream
  C. Assigns the value 432 to the PushbackInputStream
  C. Compilation Fails
  C. A Runtime exception is thrown.


3. Which of the following input stream classes always supports marking?
Please select the best answer.
  A. System.in
  B. DataInputStream
  C. FileInputStream
  D. ByteArrayInputStream
  E. None of the above


4. Which of the following cannot be chained to a FileInputStream?
Please select the best answer.
  A. BufferedInputStream
  B. DataInputStream
  C. PrintStream
  D. PushbackInputStream
  E. None of the above


Your score is 0.0