Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What kind of stream does ByteArrayInputStream represent?

  1. Character stream

  2. Byte stream

  3. Object stream

  4. Data stream

The correct answer is: Byte stream

ByteArrayInputStream represents a byte stream because it is used to read input as a sequence of bytes. This means that it reads the data as individual elements of bytes, as opposed to the other options. Character streams are used to read text data, object streams are used to serialize and deserialize objects, and data streams are used for reading primitive data types. Therefore, B is the most suitable choice for the type of stream represented by ByteArrayInputStream.