Multiple choice

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

  1. 9

  2. 6

  3. 5

  4. 8

  5. 7

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

There five subclasses of the OutputStream class are:

  1. FileOutputStream for writing bytes into file
  2. ObjectOutputStream for writing objects and primitive data types to output stream.
  3. ByteArrayOutputStream for output stream that writes byte into array.
  4. pipedOutputStream for writing into a piped stream.
  5. FilterOutputStream for filtering output into an existing stream. So, this is the correct answer.