Please explain why Exception comes in first program but not in second program.
1) without return statement in read method
class Example
{
public s
Branching statements(return ,goto ) should no be used inside finally because execution of such statement nullifies other instructions which are executed before finally.
The Java Language Specification says : If execution of the try block completes abruptly for any other reason R, then the finally block is executed, and then there is a choice:
Note - A return statement inside a finally block will cause any exception that might be thrown in the try or catch block to be discarded.