Exam 11: Handling Exceptions and Events

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following will cause the first exception to occur in the code in the accompanying figure?

(Multiple Choice)
4.9/5
(39)

The JList GUI component generates events that call the actionStateChanged method.

(True/False)
4.7/5
(41)

The class Throwable is derived from the class Exception.

(True/False)
5.0/5
(36)

The order in which catch blocks are placed in a program has no impact on which catch block is executed.

(True/False)
4.8/5
(30)

An unchecked exception is any exception that causes a program to terminate.

(True/False)
4.9/5
(38)

For interfaces such as WindowListener that contain more than one method, Java provides the class WindowAdapter.

(True/False)
4.7/5
(40)

If you want to provide your own code to terminate the program when the window is closed, or if you want the program to take a different action when the window closes, then you use the interface ____.

(Multiple Choice)
4.8/5
(42)

The try block contains statements that should be executed regardless of whether or not an exception occurs.

(True/False)
4.7/5
(28)

What can a method do with a checked exception?

(Multiple Choice)
4.9/5
(47)

If there is a finally block after the last catch block, the finally block always executes.

(True/False)
4.9/5
(41)

When an exception occurs in a method, you can use the method printStackTrace to determine the order in which the methods were called and where the exception was handled.

(True/False)
5.0/5
(33)

Which class of exceptions is NOT checked?

(Multiple Choice)
4.8/5
(39)

When an exception occurs, an object of a particular exception class is created.

(True/False)
4.9/5
(30)

Which method throws the second exception in the code in the accompanying figure?

(Multiple Choice)
4.9/5
(41)

How many finally blocks can there be in a try/catch structure?

(Multiple Choice)
4.8/5
(35)

To handle window events, if the class containing the application program does not extend the definition of another class, you can make that class extend the definition of the class ____.

(Multiple Choice)
4.8/5
(36)

Making a reference to an object that has not yet been instantiated would throw an exception from the NullPointerException class.

(True/False)
4.7/5
(31)

The class Object is derived from the class Throwable.

(True/False)
4.9/5
(42)

The MouseListener interface defines ____ methods.

(Multiple Choice)
4.7/5
(34)

The methods getMessage and printStackTrace are private methods of the class Throwable.

(True/False)
4.9/5
(43)
Showing 21 - 40 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)