Java I/O Streams

Questions covering Java byte streams, character streams, and file handling classes

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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

  1. 6
  2. 5
  3. 4
  4. 3
  5. 2
Question 2 Multiple Choice (Single Answer)

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

  1. read(byte[ ] b)
  2. mark(int limit)
  3. read()
  4. Both (1) and (3)
  5. All of the above
Question 3 Multiple Choice (Single Answer)

How many subclasses are there of the InputStream class?

  1. 9
  2. 8
  3. 7
  4. 6
  5. 5
Question 4 Multiple Choice (Single Answer)

How many subclasses of the OutputStream Class are present in Java?

  1. 9
  2. 6
  3. 5
  4. 8
  5. 7
Question 5 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 the above
Question 6 Multiple Choice (Single Answer)

Byte stream are defined by using _____ class hierarchy.

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

Character Stream class is defined by using _____ class hierarchy.

  1. 7
  2. 5
  3. 2
  4. 4
  5. None of these
Question 8 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 the above
Question 9 Multiple Choice (Single Answer)

Which of the following is/are the subclasses of the OutputStream Class?

  1. ObjectOutputStream
  2. PipedOutputStream
  3. ByteOutputStream
  4. Both (1) and (2)
  5. All of the above
Question 10 Multiple Choice (Single Answer)

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

  1. CharWriter
  2. StringWriter
  3. BufferedWriter
  4. Both (1) and (2)
  5. Both (1) and (3)
Question 11 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 12 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 the above
Question 13 Multiple Choice (Single Answer)

How many subclasses of the Reader Class are there in Java?

  1. 9
  2. 8
  3. 7
  4. 6
  5. 5
Question 14 Multiple Choice (Single Answer)

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

  1. StrinBufferedInputStream
  2. FilterInputStream
  3. SequenceInputStream
  4. Both (2) and (3)
  5. All of the above
Question 15 Multiple Choice (Single Answer)

How many subclasses of the Writer class are there in Java?

  1. 7
  2. 6
  3. 8
  4. 9
  5. 5