Exam 16: Exception Handling

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If some part of your program or any library functions that are called) throw an exception, then if this exception is not handled in your code, your program will _____.

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

exit

It is legal to have a catch block with no parameter.

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

True

If a function throws an exception, it must be caught inside that function.

Free
(True/False)
4.9/5
(43)
Correct Answer:
Verified

False

A class that is used for exceptions is declared

(Multiple Choice)
4.8/5
(38)

Which type of exception is thrown if a call to the new operator fails?

(Multiple Choice)
4.8/5
(39)

Which of the following function declaration correctly specifies that two types of exceptions are thrown?

(Multiple Choice)
4.8/5
(40)

The following function does not throw any unhandled exceptions void f1 ) throw );

(True/False)
4.9/5
(38)

Functions that might throw an exception must have a throw list.

(True/False)
4.9/5
(41)

When a throw statement is executed,

(Multiple Choice)
4.9/5
(40)

Which of the following is not a valid reason for using exception handling?

(Multiple Choice)
4.9/5
(36)

The catch block is also known as the ___________.

(Short Answer)
4.8/5
(38)

The following catch block catches all __________ exceptions. catch string e) { }

(Short Answer)
4.9/5
(38)

If class A is derived from class B, and a virtual function in class B throws an exception, then the overridden version of that function in class A must

(Multiple Choice)
4.8/5
(39)

If the following function throws an unhandled exception, what happens? void f1);

(Essay)
4.9/5
(38)

A throw statement passes which type of value to the catch block?

(Short Answer)
4.9/5
(36)

If the following function will throw a string exception, then Void myFunction );

(Multiple Choice)
4.8/5
(32)

If you have a function that might throw an exception and some programs that use that function might want to handle that exception differently, you should

(Multiple Choice)
4.9/5
(27)

When an unusual situation or error occurs, then the ________ statement is executed.

(Multiple Choice)
4.8/5
(36)

The catch block catch ...) is known as the ______________.

(Short Answer)
4.8/5
(35)

C++ signals an error or unusual situation by __________.

(Short Answer)
4.7/5
(27)
Showing 1 - 20 of 47
close modal

Filters

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