Exam 11: Handling Exceptions and Events

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

An exception that can be recognized by the compiler is a(n) ____.

Free
(Multiple Choice)
4.9/5
(30)
Correct Answer:
Verified

B

Which class of exceptions is NOT checked?

Free
(Multiple Choice)
4.7/5
(30)
Correct Answer:
Verified

C

Which of the following exceptions might be thrown by the methods of the class String?

Free
(Multiple Choice)
4.9/5
(31)
Correct Answer:
Verified

A

The class Exception and its subclasses are designed to catch exceptions that should be caught and processed during program execution.

(True/False)
4.7/5
(30)

The class RuntimeException is part of the package java.io.

(True/False)
4.9/5
(38)

Every program with a try block must end with a finally block.

(True/False)
4.9/5
(49)

What can a method do with a checked exception?

(Multiple Choice)
4.9/5
(35)

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

(True/False)
4.8/5
(43)

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

(True/False)
4.8/5
(40)

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)
4.8/5
(35)

What happens in a method if there is an exception thrown in a try block but there is no catch block following the try block?

(Multiple Choice)
4.9/5
(35)

Which of the following is NOT a method of the class Throwable?

(Multiple Choice)
4.8/5
(41)

To handle window events, you first create a class that implements the interface WindowListener and then create and register objects of that class.

(True/False)
4.9/5
(31)

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
(41)

The StringIndexOutOfBoundsException could be thrown by the method parseInt of the class Integer.

(True/False)
4.8/5
(33)

The MouseListener interface defines ____ methods.

(Multiple Choice)
4.9/5
(38)

Which of the following methods prints a list of the methods that were called before the exception was thrown?

(Multiple Choice)
4.8/5
(32)

How many constructors does the class Exception have?

(Multiple Choice)
4.8/5
(31)

When is a finally block executed?

(Multiple Choice)
4.9/5
(34)

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)
Showing 1 - 20 of 50
close modal

Filters

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