It doesn't give any compilation error.. it compiles successfully.. It throws ArrayIndexOutOfBoundException and it is caught by catch (Exception e) as it matches all the exceptions.
It will not compile The ERror because of the catching exceptions should start from child Class of Exceptions and from there it can go to parent class. If the catch blocks hierarchy is changed it will compile successfully.
This will throw a compiler error while catching exceptions we should first catch child class exceptions and then only base class. The reason is if we follow this we will get the more specific reason for the failure ie what caused the exception to rise.
Here the child exception is caught before parent. In your program there are two compilation errors they are println is typed wrong and ArrayIndexOutOfBoundsException is also typed worng which result in compilation errors
ArrayIndexOutOfBoundException is UnCheckedException but i got error in compile time. Compile time exceptions are Checked Exception. I need Correct ans. plz send my mail id