Filters
Question type

The braces are not necessary on a try block.

A) True
B) False

Correct Answer

verifed

verified

Exception handling is used to _____________.

Correct Answer

verifed

verified

handle error situati...

View Answer

Functions may potentially throw at most one exception.

A) True
B) False

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

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

Which of the following code fragments are illegal?


A) try {
Try
{
//other code here
}
Catchint e)
{
//code here
}
}
Catchfloat e)
{
//code here
}
B) try {
//code here
}
Catchint e)
{
//code here
Try
{
//code here
}
Catchstring e)
{
}
}
C) All of the above
D) None of the above

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

The block of code that handles an exception is called


A) the catch block
B) the try block
C) a function
D) an error block

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

If a function will possibly throw an unhandled exception, the try block should


A) be in the function definition
B) encompass the function call
C) be in the catch block
D) not be used

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

Showing 41 - 47 of 47

Related Exams

Show Answer