For Chapter 10
THIS PAGE CONTAINS A SAMPLE quiz on material from
Chapter 10 of this on-line
Java textbook. You should be able to answer these questions after
studying that chapter. Sample answers to all the quiz questions can
be found here.
In Java, input/output is done using streams. Streams are an
abstraction. Explain what this means and why it is important.
Java has two types of streams: character streams and byte streams. Why?
What is the difference between the two types of streams?
What is a file? Why are files necessary?
What is the point of the following statement?
out = new PrintWriter( new FileWriter("data.dat") );
Why would you need a statement that involves two different
stream classes, PrintWriter and FileWriter?
The package java.io includes a class named URL.
What does an object of type URL represent, and how
is it used?
Explain what is meant by the client / server model of
What is a Socket?
What is a ServerSocket and how is it used?
Network server programs are often multithreaded.
Explain what this means and why it is true.
Write a complete program that will display the first ten
lines from a text file. The lines should be written to
standard output, System.out. The file name is
given as the command-line argument args. You
can assume that the file contains at least ten lines.
Don't bother to make the program robust.