I was trying to go through with exception handling and found that any exception thrown by a method should be catch. but when I tried following code it works and have not shown any error while compiling while the method as per javadoc throws IndexOutOfBoundsException.
Not every exception, only so-called checked exceptions. Note that Integer.parseInt also throws an unchecked exception. Unchecked exceptions are those that extend java.lang.RuntimeException and java.lang.Error.