Exception Handling.

POST TEST


Question 1:
……………………….. exception is caused when an applet tries to perform an action not allowed by the browser’s security setting.
Throwable.
Restricted.
Security
none of the above.


Question 2:
…………………….. exception is thrown when an attempt is made to access an array element beyond the index of the array.
ArrayIndexOutofBounds
Security
Restricted
Throwable


Question 3
The ……………………. statement is passed a single parameter, which is reference to the exception object thrown.
throw.
catch.
finally.
try.


Question 4:
Every try statement should be followed by at least one catch statement; otherwise …………………. will occur.
no execution.
compilation error.
null.
zero.


Question 5:
……………… is caused by general I/O failures, such as inability to read from file.
I/O failure.
I/O exception
I/O inability
I/O distortion


Question 6:
When an exception in a try block is generated, the Java treats the multiple ………………. statements like cases in switch statement.
throw.
catch.
finally.
try


Question 7:
. The …………………. statement can be used to handle an exception that is not caught by any of the previous catch statement.
throw.
catch.
finally.
try.


Question 8:


State whether the following statements are True or False. i) A catch can have comma-separated multiple arguments. ii) Throwing an Exception always causes program termination.
True, False.
False, True.
True, True.
False, False

Number of score out of 7 = Score in percentage =