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
All Methods Instance Methods Concrete Methods 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 Detail
-
ExceptionInInitializerError
public ExceptionInInitializerError()
Constructs a newExceptionInInitializerErrorthat includes the current stack trace.
-
ExceptionInInitializerError
public ExceptionInInitializerError(String detailMessage)
Constructs a newExceptionInInitializerErrorwith the current stack trace and the specified detail message.- Parameters:
detailMessage- the detail message for this error.
-
ExceptionInInitializerError
public ExceptionInInitializerError(Throwable exception)
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 Detail
-
getException
public Throwable getException()
Returns the exception that is the cause of this error.- Returns:
- the exception that caused this error.
-
-