Questions
Question 1 Multiple Choice (Single Answer)
In exception handling, which block throws an exception?
- Catch
- Throw
- Throws
- Try
Question 2 Multiple Choice (Single Answer)
An exception is a _____________.
- compile time error
- runtime error
- infinite loop
- none of these
Question 3 Multiple Choice (Single Answer)
Which of the following is not an example of exception?
- Wrongly written inbuilt function
- Divide by zero error
- Array out of index error
- File not found error
Question 4 Multiple Choice (Single Answer)
Which of the following statements is used to rethrow an exception?
- Throw(exception);
- Throw exception;
- Throw;
- Throws;
Question 5 Multiple Choice (Single Answer)
Which of the following is the correct sequence of statements for handling an error?
A. Throw the exception
B. Handle the exception
C. Hit the exception
D. Catch the exception
- ABCD
- ABDC
- BACD
- CADB
Question 6 Multiple Choice (Single Answer)
Which of the following statements is/are correct?
A. Multiple catch clauses with one try block.
B. Catch block only catches the exception.
- Only A
- Only B
- Both A and B
- Neither A nor B
Question 7 Multiple Choice (Single Answer)
The exception that is uncaught invokes the function _______.
- end()
- exit()
- terminate()
- block()
Question 8 Multiple Choice (Single Answer)
What is the meaning of following catch block?
catch(...)
{
Statements;
}
- Handle any exception that is not caught by other handlers
- Handle all I/O exceptions
- Handle all exceptions
- None of these