Your last name (BLOCK CAPITALS): _______________ first name: __________

Two-character quiz section Ired): ______

CSE143

Miniquiz #06  July 17, 2003

A for True, B for False:

1. ___ In Java, char sometimes refers to 8-bit ASCII characters, and sometimes refers to 16-bit Unicode characters.

2. ___ Exceptions which are subclasses of java.io.IOException are "checked".

3. ___ The Java keyword throws is used to throw an exception.

4-7___ Fill in the four blank slots in the following table with the correct abstract class name (choices are Reader, Writer, InputStream, and OutputStream).

  bytes chars
data coming into the program _______________ _____________
data coming from the program _______________ _____________

 

8-9. With reference to the method eMethod  (assume the method compiles without error): True, False or It Depends:

___ eMethod never throws an exception.

If you answer True, explain why eMethod can never throw an exception. If you answer False, give a circumstance under which eMethod will throw an exception.  If you answer It Depends, explain exactly what it depends on.

 

 

 

public String eMethod(IContestant contestant) {

    try {

        return contestant.getName( );

   }  catch (Exception e) {

        return null;

    }

}