Multiple choice

How many subclasses are there of the InputStream class?

  1. 9

  2. 8

  3. 7

  4. 6

  5. 5

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is the correct answer. There are 7 subclasses of the InputStream class. These are:

  1. FileInputStream for reading bytes from a file.
  2. ObjectInputStream for readin objects and primitive data types from input stream.
  3. SequenceInputStream for readin from a sequence of streams.
  4. ByteArrayInputStream for Stream that reads a byte array.
  5. pipedInputStream for reading from a piped stream.
  6. FilterInputStream for filtering input from Existing Stream.
  7. StringBufferInputStream for reading from a string.