Exam 10: Exception Handling

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

A(n) ____________________ block includes any number of statements that might cause exceptions.

Free
(Short Answer)
4.8/5
(35)
Correct Answer:
Verified

try

A system of passing exceptions through the chain of calling methods has great advantages because it allows methods to handle exceptions wherever the programmer has decided it is most appropriate.

Free
(True/False)
4.8/5
(32)
Correct Answer:
Verified

True

Each ____________________ block can catch only one type of exception.

Free
(Short Answer)
4.8/5
(34)
Correct Answer:
Verified

catch

Only the first ____________________ statement in a try block throws an exception.

(Short Answer)
4.9/5
(39)

Dividing by 0 is an error in every programming language because it is an operation that is not defined mathematically.

(True/False)
4.7/5
(28)

A ____ is a segment of code that can handle an exception that might be thrown by the try block that precedes it.

(Multiple Choice)
4.8/5
(35)

You can only place one statement within each try block.

(True/False)
4.9/5
(39)

Using a traditional error-handling method to avoid dividing by 0 prevents the error and makes the method more flexible.

(True/False)
4.7/5
(39)

A catch block consists of four different elements: the keyword catch, followed by parentheses that contain an exception type and identifier, statements that take action to handle the error condition, an endcatch statement, and a return statement.

(True/False)
4.7/5
(35)

The block of code that processes an error in exception handling "____."

(Multiple Choice)
4.8/5
(46)

When a division by 0 happens during the execution of a method, the application that calls the method typically terminates, control returns to the operating system, and a(n) ____________________ is generated.

(Short Answer)
4.8/5
(35)

____________________ code statements are program statements that can never execute under any circumstances.

(Short Answer)
4.9/5
(37)

When an exception is created and ____________________, the catch block that follows and contains an Exception argument executes.

(Short Answer)
5.0/5
(41)

A ____ is one that sends an exception object out of a method so it can be handled elsewhere.

(Multiple Choice)
4.8/5
(44)

____ statements are program statements that can never execute under any circumstances.

(Multiple Choice)
4.8/5
(38)

To create your own throwable exception, you usually ____________________ a built-in Exception class.

(Short Answer)
4.8/5
(28)

As opposed to exception handling, program ____________________ is abrupt and unforgiving.

(Short Answer)
4.9/5
(43)

____ is thrown when an object reference does not correctly refer to a created object.

(Multiple Choice)
4.9/5
(38)

To create your own throwable Exception, you usually extend a built-in ____ class.

(Multiple Choice)
4.8/5
(39)

If method A calls method B and method B throws an exception, which method will catch the exception, assuming all methods have a catch block?

(Multiple Choice)
4.8/5
(32)
Showing 1 - 20 of 50
close modal

Filters

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