Name

ExceptionInInitializerError

Synopsis

This error is thrown by the Java Virtual Machine when an exception occurs in the static initializer of a class. You can use the getException( ) method to obtain the Throwable object that was thrown from the initializer. In Java 1.4 and later, getException( ) has been superseded by the more general getCause( ) method of the Throwable class.

java.lang.ExceptionInInitializerError

Figure 10-22. java.lang.ExceptionInInitializerError

public class ExceptionInInitializerError extends LinkageError {
// Public Constructors
     public ExceptionInInitializerError( );  
     public ExceptionInInitializerError(String s);  
     public ExceptionInInitializerError(Throwable thrown);  
// Public Instance Methods
     public Throwable getException( );                                    default:null
                  // Public Methods Overriding Throwable
                  1.4  public Throwable getCause( );                                    default:null
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.