ExceptionInInitializerError

ExceptionInInitializerError is a child class of Error in Java, Hence it is an unchecked exception. ExceptionInInitializerError is automatically raised by JVM if any Exception occurs during the implementation of static variable assignment or static blocks.

public class  ExceptionInInitalizer{
    static int x = 10/0;
    public static void main(String[] args) {
        System.out.println(x);
    }
}
ExceptionInInitializerError

Similar Java Tutorials

Leave a Comment