Consider this code:

```
public class CheckException 
{
    public static void main(String [] args)
    {       
       int a = 10;
        try{
            int c = a/0;
        } catch(Exception e){

        } catch(ArithmeticException e1){    \\ compilation error

        }
    }   
}

```

My doubt is compilation error is generated at the second catch because it's already handled by the super type Exception. But why compilation error does not come when the second catch block comes to the first's position and and first comes to the second's position(Like below)? 

```
public class CheckException {

public static void main(String [] args){

    int a = 10;
    try{
        int c = a/0;
    } catch(ArithmeticException e){
//       System.out.println("1");   
    } 
    catch(Exception e1){
//          System.out.println("2");
    }
}

}

```

Then also the first block(i.e. ArithmeticException) will handle the exception before it reaches to catch(Exception e).

**Modified**

Now I am adding all the unchecked exceptions before catch(Exception e).

```
public class CheckException {

public static void main(String [] args){

    int a = 10;
    try{
        int c = a/0;
    } catch(ArithmeticException e){
     System.out.println("1");   
    } 
    catch(ArrayIndexOutOfBoundsException e1){
        System.out.println("2");
    }
    catch(ClassCastException  e1){
        System.out.println("2");
    }
    catch(IllegalArgumentException  e1){
        System.out.println("2");
    }
    catch(IllegalStateException  e1){
        System.out.println("2");
    }
    catch(NullPointerException  e1){
        System.out.println("2");
    }
    catch(AssertionError e1){
        System.out.println("2");
    }
    catch(ExceptionInInitializerError  e1){
        System.out.println("2");
    }
    catch(StackOverflowError  e1){
        System.out.println("2");
    }
    catch(NoClassDefFoundError  e1){
        System.out.println("2");
    }
    catch(ArrayStoreException e1){
        System.out.println("2");
    }
    catch(IllegalMonitorStateException e1){
        System.out.println("2");
    }
    catch(IndexOutOfBoundsException e1){
        System.out.println("2");
    }
    catch(NegativeArraySizeException e1){
        System.out.println("2");
    }
    catch(SecurityException e1){
        System.out.println("2");
    }
    catch(UnsupportedOperationException e1){
        System.out.println("2");
    }
    catch(Exception e1){
        System.out.println("2");
    }
}

}

```

Now, all the unchecked exceptions are getting handled before reaching catch(Exception e). So, is there anymore unchecked exception other than these because of which compilation error is not generated? or is it something else?