Exam 12: Exception Handling

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

In order to use a variable both with a try or catch block and afterward, you must declare the variable before the ____ block begins.

(Multiple Choice)
4.9/5
(37)

What things might a programmer do to cause a potential exception in a program?

(Essay)
4.7/5
(42)

Placing data conversion attempts in a try block allows you to handle potential data conversion errors caused by careless user entry.

(True/False)
4.9/5
(40)

If you create an object using Java's BigDecimal class, and then perform a division that results in a non-terminating decimal division such as 1/3, but specify that an exact result is needed, a(n) ____________________ is thrown.

(Short Answer)
4.7/5
(40)

   The example code above uses the getMessage() method. Explain how the getMessage() method makes error message generation more specific to the error encountered. The example code above uses the getMessage() method. Explain how the getMessage() method makes error message generation more specific to the error encountered.

(Essay)
4.9/5
(43)

A variable declared within a try or catch block is ____ to that block.

(Multiple Choice)
4.9/5
(37)

What is an Exception class? Give an example.

(Essay)
4.8/5
(32)

A(n) ____ is a Java language feature that can help you detect logic errors that do not cause a program to terminate, but nevertheless produce incorrect results.

(Multiple Choice)
4.9/5
(33)

When you catch an Exception object, you can call ____________________ to display a list of methods in the call stack so you can determine the location of the statement that caused the exception.

(Short Answer)
4.9/5
(40)

The code within a finally block cannot execute if the preceding try block identifies an exception.

(True/False)
4.8/5
(30)

   Using the example code above, complete the statement of the catch block to generate the message that comes with the caught ArithmeticException . Using the example code above, complete the statement of the catch block to generate the message that comes with the caught ArithmeticException .

(Short Answer)
4.9/5
(33)

Programs would be less clear if you had to account for ____ exceptions in every method declaration.

(Multiple Choice)
4.8/5
(38)

Assertions are meant to be helpful in the ____ stage of a program.

(Multiple Choice)
4.8/5
(33)

When an exception is a checked exception, client programmers are forced to deal with the possibility that an exception will be thrown.

(True/False)
4.8/5
(36)

The ____ class represents more serious errors from which your program usually cannot recover.

(Multiple Choice)
4.7/5
(32)

To create your own throwable Exception class, you must extend a subclass of Catchable .

(True/False)
4.8/5
(38)

When you have actions you must perform at the end of a try…catch sequence, you can use a ____ block.

(Multiple Choice)
4.8/5
(39)

When a program contains multiple ____ blocks, they are examined in sequence until a match is found for the type of exception that occurred.

(Multiple Choice)
4.8/5
(43)

Any ____________________ block might throw an Exception for which you did not provide a catch block.

(Short Answer)
4.8/5
(34)

Which method constructor constructs a new exception with the specified detail message and cause?

(Multiple Choice)
4.7/5
(37)
Showing 41 - 60 of 66
close modal

Filters

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