Ganesh
This problem is similar to your other post
https://coderanch.com/t/418092/java-programmer-SCJP/certification/checked-exception Also, for the code you posted, I dont think the options are right with the code AS-IS...
I tried the following modified code... And with this code, options 2 and 4 are correct.
Line marked Comment-1 : Uncomment this line alone, and comment out the
catch(SQLException e) block... What happens is, IOException is thrown, catch (IOException e) is eligible to catch it, buy finally overrides the return with CloneNotSupportedException. Hence, CloneNotSupportedException is thrown at the end.
Line marked Comment-2 : Uncomment this line alone...This calls another function m2() that declares that it COULD throw an Exception but actually it does not ...
In this case, since no exception is thrown, no catch is run but finally runs thus throwing a CloneNotSupportedException.
I feel the options given are not suitable ones for the original code because there are compilation errors. Sorry, I didnt compile the code earlier.