Exam 12: Handling Exceptions

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

When any object is thrown with a throw statement, what conditions does a subsequent catch block have to meet to have a usable match?

(Essay)
4.7/5
(32)

Why would you want to write an exception specification?

(Essay)
4.8/5
(30)

The ____ function was created to solve the universal problem of insufficient memory.

(Multiple Choice)
4.8/5
(42)
Match each term with the correct statement below.
Premises:
one or more statements that the program attempts to execute, but which might result in thrown exceptions
Responses:
message
exception specification
try block
Correct Answer:
Verified
Premises:
Responses:
one or more statements that the program attempts to execute, but which might result in thrown exceptions
message
(Matching)
4.9/5
(44)

Which constants can you use as arguments to the exit() function?

(Essay)
5.0/5
(35)

When you include multiple catch blocks in a program, ____ catch block that is able to accept a thrown object is the one that will execute.

(Multiple Choice)
4.8/5
(30)

____________________ are errors that occur during execution of object-oriented programs, and are so-named because, presumably, they are not usual occurrences.

(Short Answer)
4.9/5
(44)

In object-oriented terminology, what is a message?

(Essay)
4.9/5
(38)

Describe the general principle underlying good object-oriented error handling.

(Essay)
4.9/5
(35)

You should be careful when writing an exception specification using a(n) ____________________ because any type might eventually be instantiated.

(Essay)
4.9/5
(38)
Match each term with the correct statement below.
Premises:
passed object that contains information
Responses:
exception class
exit() function
message
Correct Answer:
Verified
Premises:
Responses:
passed object that contains information
exception class
(Matching)
4.9/5
(44)

If you use a default catch block, it ____.

(Multiple Choice)
4.9/5
(48)

If a function throws an exception, but the function call has not been placed in a(n) ____________________ block, then the program terminates.

(Short Answer)
4.9/5
(36)
Match each term with the correct statement below.
Premises:
contains statements that execute when an exception is thrown
Responses:
default exception handler
message
exit() function
Correct Answer:
Verified
Premises:
Responses:
contains statements that execute when an exception is thrown
default exception handler
(Matching)
4.7/5
(39)

When using the exit() function, it is traditional to use a non-zero argument to indicate a program exited normally, and a 0 argument to indicate an error.

(True/False)
4.9/5
(32)

When should you use exception handling?

(Essay)
4.8/5
(33)
Match each term with the correct statement below.
Premises:
object that contains information that is passed from the place where a problem occurs to another place that will handle the problem
Responses:
exception specification
message
try block
Correct Answer:
Verified
Premises:
Responses:
object that contains information that is passed from the place where a problem occurs to another place that will handle the problem
exception specification
(Matching)
4.9/5
(32)

A catch block ____ display, or to use in any way, what is thrown.

(Multiple Choice)
4.9/5
(33)

You ____________________ a function; if it throw s an exception, you catch and handle it.

(Short Answer)
4.7/5
(36)

You create a default exception handler by creating a(n) ____ block with an ellipsis (…) as its parameter.

(Multiple Choice)
4.8/5
(40)
Showing 21 - 40 of 51
close modal

Filters

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