Java I/O Streams

Test your knowledge of Java I/O stream classes (InputStream, OutputStream, Reader, Writer), their methods, subclasses, and hierarchies.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following methods is/are defined in the OutputStream class?

  1. flush()
  2. write(byte[ ] b)
  3. write(byte[ ] b, int offset, int len)
  4. both 1 and 3
  5. all of these
Question 2 Multiple Choice (Single Answer)

Byte stream are defined by using _____ class hierarchies.

  1. four
  2. three
  3. two
  4. five
  5. none of these
Question 3 Multiple Choice (Single Answer)

Which of the following is/are the subclasses of the Output Stream class?

  1. Object Output Stream
  2. Piped Output Stream
  3. ByteOutputStream
  4. Both 1 and 2
  5. All of these
Question 4 Multiple Choice (Single Answer)

How many subclasses of Reader Class are there in Java?

  1. Nine
  2. Eight
  3. Seven
  4. Six
  5. Five
Question 5 Multiple Choice (Single Answer)

Which of the following methods is/are defined in the Reader class?

  1. skip(long)
  2. mark(int limit)
  3. reset()
  4. both 1 and 3
  5. all of these
Question 6 Multiple Choice (Single Answer)

The stream class can be categorized into how many groups depending upon the data on which they operate?

  1. 5
  2. 4
  3. 3
  4. 2
  5. None of these
Question 7 Multiple Choice (Single Answer)

Which of the following is/are not the subclasses of the Reader class?

  1. StringReader
  2. PipeReader
  3. InputReader
  4. Both 1 and 2
  5. Both 1 and 3
Question 8 Multiple Choice (Single Answer)

Which of the following is/are the subclasses of the InputStream class?

  1. StrBufferedInputStream
  2. FilterInputStream
  3. SequenceInputStream
  4. Both 2 and 3
  5. All of these
Question 9 Multiple Choice (Single Answer)

Which of the following is/are not the subclasses of Writer class in java?

  1. CharWriter
  2. StringWriter
  3. BufferedWriter
  4. Both 1 and 2
  5. Both 1 and 3
Question 10 Multiple Choice (Single Answer)

Which of the following methods is/are defined in the File class in Java?

  1. getPath()
  2. getName()
  3. length()
  4. both 1 &and 2
  5. all of these
Question 11 Multiple Choice (Single Answer)

Which of the following methods is/are defined in the InputStream class of Bytes Stream?

  1. read(byte[ ] b)
  2. mark(int limit)
  3. read()
  4. both 1 and 3
  5. all of these
Question 12 Multiple Choice (Single Answer)

How many subclasses of the Output Stream class are present in Java?

  1. Nine
  2. Six
  3. Five
  4. Eight
  5. Seven
Question 13 Multiple Choice (Single Answer)

Character Stream class is defined by using _____ class hierarchies.

  1. seven
  2. five
  3. two
  4. four
  5. none of these
Question 14 Multiple Choice (Single Answer)

How many subclasses of Writer class are there in Java?

  1. Seven
  2. Six
  3. Eight
  4. Nine
  5. Five
Question 15 Multiple Choice (Single Answer)

How many subclasses are there in the InputStream class?

  1. Nine
  2. Seven
  3. Eight
  4. Six
  5. Five