mohitkumar gupta wrote:
b) ^
public static void main(String arg[]) throws Exception
gives:
unreachable statement
new A().call();}catch(TestException e){throw e;System.out.println("me e eemeemme");}
In this case, main() throws Exception, so there is no problems with throwing and catching Exceptions.
But the println() statement inside catch block in method call() is never reached.
This is because it rethrows the caught exception in previous line every time. So, the control flow goes outside the method - not reaching the println() statement.