1.

Which part of code gets executed whether exception is caught or not?(a) finally(b) try(c) catch(d) throwThis question was addressed to me in a national level competition.I want to ask this question from Exception Handling topic in chapter Exception Handling of Java

Answer»

The correct option is (a) FINALLY

The EXPLANATION is: Finally block of the code gets executed regardless EXCEPTION is caught or not. File close, database connection close, ETC are usually DONE in finally.



Discussion

No Comment Found

Related InterviewSolutions