Java - Online Test - Exceptions - javasearch.buggybread.com
OCJP / SCJP
New in Java 8
Java 8 Lambda
Java 8 java.time
Search Java Test Questions
223 test questions in repository.
Java - Test Questions on 'Exceptions' - 7 questions found
Which of the following exception is thrown when we try to access element which is beyond the size ?
Checked exception needs to be ...
Method needs to declare that it throws these exception
Either A or B
Both A and B
Which of the following is not possible ?
try block followed by catch
try block followed by finally
try block followed by catch block and then finally
try block without catch or finally block
Which of the following can throw ClassCastException ?
Casting to incompatible data type
Casting to Strings
x instanceOf y returns false ..
if x is an instance of y class
if x is an instance of class implementing y interface
if x is an instance of class extending y class
if x is an instance of Class which is a parent of Y class
In which case finally won't get executed ?
in case of exception
in case of normal execution
in case of return statement before end of try block
in case of force program termination
In Case a method is declared to throw an exception , We can only use a call to that method if ...
We use the call within try block and catch the exception
We declare that the method is expected to throw the exception using throws
Both 1 and 2
Either 1 or 2
comments powered by Disqus.
comments powered by