Answer the following statements true (T) or false (F)

1. In C++ an exception object must be derived from the exception class defined in the standard library.
2. An exception object in C++ can have any type in C++ including built-in types, an enum type, a string, a C-string, a user defined class, without regard to whether the class is derived from the standard library exception class.
3. The context in which the throwing of an exception is detected is the try block.
4. The context in which an exception is handled (or managed) is the throw block.
5. Statements that cause an exception must be part of a try block.


1. False
An exception object in C++ can have any type in C++ including built-in types, an enum type, a string, a C-string, a user defined class, without regard to whether the class is derived from the standard library exception class.
2. False
An exception is signaled or raised with the keyword throw (not catch) followed by an exception object that may be of any C++ type.
3. True
The throw statement that actually raises the exception may not be visible in the try block. It may be buried inside a function call in the try block.
4. False
The context in which an exception is handled (or managed) is the catch block.
5. False
Statements that cause an exception to be thrown need not be in a try block. However, if the exception is to be caught, the throw statement must be directly in the try block or there must be a call to a function that has the throw statement in the function in the try block.

Computer Science & Information Technology

You might also like to view...

Creates transitions from one color to another without using images.

a. Text-shadow property b. Multiple backgrounds c. Gradient backgrounds d. Opacity property

Computer Science & Information Technology

____________________ is the term used to describe an algorithm's careful use of resources.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The programmer design tool used to design the whole program is the flowchart.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

FIGURE EX 4-1 Which of the options shown in the Arrange Windows dialog box in the accompanying figure would you use to move or copy worksheets to another workbook using the Mouse method?

A. Tiled B. Horizontal C. Vertical D. Cascade

Computer Science & Information Technology