Package java.lang
Class ExceptionInInitializerError
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.LinkageError
java.lang.ExceptionInInitializerError
- All Implemented Interfaces:
Serializable
public class ExceptionInInitializerError extends LinkageError
Thrown when an exception occurs during class initialization.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ExceptionInInitializerError()Constructs a newExceptionInInitializerErrorthat includes the current stack trace.ExceptionInInitializerError(String detailMessage)Constructs a newExceptionInInitializerErrorwith the current stack trace and the specified detail message.ExceptionInInitializerError(Throwable exception)Constructs a newExceptionInInitializerErrorwith the current stack trace and the specified cause. -
Method Summary
Modifier and Type Method Description ThrowablegetCause()Returns the cause of this error, ornullif there is no cause.ThrowablegetException()Returns the exception that is the cause of this error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ExceptionInInitializerError
public ExceptionInInitializerError()Constructs a newExceptionInInitializerErrorthat includes the current stack trace. -
ExceptionInInitializerError
Constructs a newExceptionInInitializerErrorwith the current stack trace and the specified detail message.- Parameters:
detailMessage- the detail message for this error.
-
ExceptionInInitializerError
Constructs a newExceptionInInitializerErrorwith the current stack trace and the specified cause. The exception should be the one which originally occurred in the class initialization code.- Parameters:
exception- the exception that caused this error.
-
-
Method Details