Note that i know the rules regarding

> 
> ExceptionInInitializerErrors
> 
> 
> 

*it says: Any
exception thrown in a static block is wrapped into
**ExceptionInInitializerError** and then that **ExceptionInInitializerError** is thrown.*
But my question is: **why** 

> 
> java.lang.ArrayIndexOutOfBoundsException
> 
> 
> 

**its thrown here** ?\*\* 

```
class AX {
    static int[] x = new int[0];
    static {
       x[0] = 10;
    } 

    public static void main(String[] args){
       AX ax = new AX();
    }
}

```