please consider following program
when i run this program it gives the output as :
m in try block
Exception in
thread "main" java.lang.ClassCastException // why does this prints before printing next line i.e. before array index out of bounds
array index out of bounds
i am always executed
at Dump39.go(Dump39.java:30)
at Dump39.main(Dump39.java:17)
Java Result: 1
when ArrayIndexOutOfBoundsException occurs the control goes to first catch block so it must first print "array index out of bounds" and then should throw ClassCastException. but it happens opposite. please help ?