Quiz on IO Streams

This is a practice quiz. The results are not recorded anywhere and do not affect your grade. The questions on this quiz might not appear in any quiz or test that does count toward your grade.

Instructions: For each question, choose the single best answer. Make your choice by clicking on its button. You can change your answers at any time. When the quiz is graded, the correct answers will appear in the box after each question.


1. The input/output package usually used with Java is:

a.    java.input
b.    java.io
c.    java.inout
d.    java.file

Correct Answer Is:


2. Can data flow through a given stream in both directions?

a.    No; a stream has one direction only, input or output.
b.    No; streams only work for output.
c.    Yes; only one stream is needed to read and write a file.
d.    Yes; but only one direction at a time.

Correct Answer Is:


3. What is the name of a stream that connects two running programs?

a.    Program stream
b.    Conduit
c.    Pipe
d.    Channel

Correct Answer Is:


4. Can a stream act as a data source for another stream?

a.    No. Streams must be connected directly to physical devices.
b.    No. Streams do not deal with data.
c.    Yes. Some streams can be connected together.
d.    Yes. An input stream can be connected to an output stream.

Correct Answer Is:


5. What is a buffer?

a.    A section of memory used as a staging area for input or output data.
b.    The cable that connects a data source to the bus.
c.    Any stream that deals with character IO.
d.    A file that contains binary data.

Correct Answer Is:


6. What is a stream that transforms data in some way called?

a.    Processing stream.
b.    Transformer.
c.    UTF stream.
d.    Pipe

Correct Answer Is:


7. A stream that is intended for general purpose IO, not usually character data, is called...

a.    Reader
b.    Writer
c.    Byte Stream
d.    Character Stream

Correct Answer Is:


8. What is the name of the abstract base class for streams dealing with character input?

a.    InputStream
b.    OutputStream
c.    Reader
d.    Writer

Correct Answer Is:


9. Is the character data used inside a Java program exactly the same format as the character data in a text file written by Java?

a.    No. Internally Java uses 8-bit character data, but text files always use ASCII.
b.    No. Internally Java programs always use 16-bit char data; but text files are written in UTF format, which is different.
c.    Yes. Java uses the same format for characters inside a program and in text files.
d.    Yes. Character data has always used the same format for all computers and all files.

Correct Answer Is:


10. What is the name of the abstract base class for streams dealing with general purpose (non-character) input?

a.    InputStream
b.    OutputStream
c.    Reader
d.    Writer

Correct Answer Is:


The number you got right:       Percent Correct:       Letter Grade:   

Click here (If you have just returned here from another page, or have re-loaded this page, you will need to click again on each of your choices for the grading program to work correctly. You may want to press the "shift key" while clicking on reload to clear the old answers.)