public class ExceptionInInitializerError extends LinkageError
ExceptionInInitializerError
is thrown when an uncaught
exception has occurred in a static initializer or the initializer for a
static variable. In general, this wraps only RuntimeExceptions, since the
compiler does not allow a checked exception to be uncaught in an
initializer. This exception only occurs during reflection, when a class
is initialized as part of another action.Constructor and Description |
---|
ExceptionInInitializerError()
Create an error without a message.
|
ExceptionInInitializerError(String s)
Create an error with a message.
|
ExceptionInInitializerError(Throwable t)
Creates an error an saves a reference to the
Throwable
object. |
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Return the exception that cause this error to be created.
|
Throwable |
getException()
Return the exception that caused this error to be created.
|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ExceptionInInitializerError()
public ExceptionInInitializerError(String s)
s
- the messagepublic ExceptionInInitializerError(Throwable t)
Throwable
object. The message string is null.t
- the exception thrownpublic Throwable getException()
Throwable.getCause()
.