Here is my program.
try {
int a = 1/0;
}
catch(Exception e) {
system.out.println("Exception block"+e);
}
catch(ArithmeticException e) {
system.out.println("Inside ArithmeticException block");
}
finally {
system.out.println("Inside Finally block");
}
In the above program i have two catch blocks and one finally block.
Which catch block will execute? Because I define the parent catch block first. So it leads to an error? Can any one help me?
I assumed that "ArithmeticException and Finally block will be executed"