Java Streams  «Prev  Next»

Java Streams Basics - Quiz

1. Which of the following is not a source of an input stream?
Please select the best answer.
  A. The console
  B. A network socket
  C. A TextArea component

2. What is the fundamental unit in which stream data is read and written?
Please select the best answer.
  A. A bit
  B. A byte
  C. An int

3. When you are entering data using the console on a Unix machine, how do you indicate the end-of-stream?
Please select the best answer.
  A. Hold down the Ctrl key and press Z
  B. Hold down the Ctrl key and press D
  C. Hold down the Ctrl key and press C

4. Java 1.1 introduced a second set of stream classes alongside the original InputStream and OutputStream hierarchy. What is the primary advantage of these new classes?
Please select the best answer.
  A. They read and write data faster than InputStream and OutputStream.
  B. They handle character-based I/O with proper Unicode and encoding support.
  C. They replace InputStream and OutputStream entirely in modern Java.