Java How to Program, 11/e Multiple Choice Test Bank 5 of 7
c. The code in a finally block is executed only if there are no catch blocks.
d. None of the above are true.
11.6 Q3: After a finally block has finished executing (and there are no exceptions
to be handled), ________.
a. control proceeds to the first statement after the finally block.
b. control returns to the throw point.
c. the application exits.
d. control proceeds to the first statement after the last catch block.
11.6 Q4: Which of the following statements is true?
a. The throw statement is used to throw an exception.
b. The throw statement is used to specify that a method will throw an exception.
c. The throw statement is used to access an exception parameter.
d. All of the above.
Section 11.7 Stack Unwinding and Obtaining
Information from an Exception Object
11.7 Q1: When an unchecked exception occurs in a method but is not caught,
________.
a. the method-call stack is “unwound.”
b. the method terminates.
c. all local variables in that method go out of scope.
d. All of the above.
11.7 Q2: Which of the following statements is false?
a. All exceptions must derive from the class Throwable.
b. The class Throwable provides the method getStackTrace that outputs the stack
trace to the standard error stream.
c. The class Throwable provides the method getMessage that returns the descriptive
string stored in an exception.
d. The string returned from class Throwable’s getMessage method contains the name
of the exception’s class.