Java I/O Streams

Questions on Java Input/Output Streams including byte streams (InputStream, OutputStream) and character streams (Reader, Writer), their classes, methods, and hierarchies.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

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

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

How many subclasses of InputStream class are there?

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

Which of the following methods is/are defined in 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 5 Multiple Choice (Single Answer)

How many subclasses of OutputStream class are present in Java?

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

Byte stream are defined by using _____ class hierarchy.

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

Character Stream class is defined by using how many class hierarchies?

  1. Seven
  2. Five
  3. Two
  4. Four
  5. None of these
Question 8 Multiple Choice (Single Answer)

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

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

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

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

How many subclasses of Reader class are there in Java?

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

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

  1. StringReader
  2. PipeReader
  3. InputReader
  4. Both 1 and 2
  5. Both 1 and 3
Question 13 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 14 Multiple Choice (Single Answer)

How many subclasses of Writer class are there in Java?

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

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

  1. StringBufferedInputStream
  2. FilterInputStream
  3. SequenceInputStream
  4. Both 2 and 3
  5. All of these