Filters
Question type

The braces are not necessary on a try block.

Correct Answer

verifed

verified

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


A) throw and catch can be used like gotos
B) the procedure for handling an error depends on the situation
C) need to handle built in exceptions
D) none of the above

Correct Answer

verifed

verified

If a function throws an exception and does not catch it,then the function definition and declaration should have _______.

Correct Answer

verifed

verified

An excepti...

View Answer

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


A) void f1exception a,exception b) ;
B) void f1 ) exception a;b) ;
C) void f1 ) throw a,throw b;
D) void f1 ) thaw a,b) ;

Correct Answer

verifed

verified

The parameter in the catch statement


A) identifies what type of exceptions are caught
B) identifies the different number of exceptions that can be caught
C) makes the catch block a function
D) must always be an e

Correct Answer

verifed

verified

The catch block is the group of statements that handle an exception.

Correct Answer

verifed

verified

A class that is used for exceptions is declared


A) differently from other classes
B) specialized only for exceptions
C) may not have objects declared of that class
D) all of the above
E) none of the above

Correct Answer

verifed

verified

If a throw list has multiple exceptions listed,they are separated by _________.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

When a throw statement is executed,


A) execution of the try block stops
B) execution of the throw block stops
C) the program always exits
D) execution of the catch block stops

Correct Answer

verifed

verified

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


A) the function definition and declaration should have a throw list
B) the function definition,but not the declaration should have a throw list
C) the function should have an empty throw list.
D) all of the above

Correct Answer

verifed

verified

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


A) try
B) throw
C) error
D) exiting

Correct Answer

verifed

verified

You should use exception handling


A) in all your programs
B) only when you can not handle the exception with simpler control structures
C) only when you use classes
D) in every function

Correct Answer

verifed

verified

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 _____.

Correct Answer

verifed

verified

The following class definition Class MyError {};


A) has no member functions or member data
B) has only a default constructor
C) is illegal
D) A and B

Correct Answer

verifed

verified

If no exception is thrown,then the _________ is ignored.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Which of the following would be a good reason for using inherited exception classes?


A) a base class exception can be passed to an exception parameter of the derived class
B) a derived class exception can be passed to an exception parameter of the base class
C) a base class exception parameter can be passed any type of exception
D) all of the above

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) ArithmeticError
B) DivideByZero
C) bad_alloc
D) MemoryError

Correct Answer

verifed

verified

Showing 21 - 40 of 47

Related Exams

Show Answer