Can anybody explain me the o/p of following code
public class Question46{
public static void main(
String[] args) throws Exception{
try{
int i=5/(int)Math.random();
System.out.println("i="+i);
} catch(ArithmeticException ae) {
throw new Exception("thrown from first catch");
} catch(Exception e){
throw new Exception("thrown from second catch");
} finally {
return;
}
}
}
options are
A. An exception is thrown and the exception message thrown from first catch is diplayed with the exception stack trace.
B. An exception is thrown and the exception message thrown from second catch is diplayed with the exception stack trace.
C. Prints nothing.
D. Compilation error.
E. Prints i=? where ? stands for the generated random value.
Correct option is C
Plz explain me how?
Bye
-Swati