智能客服
你问我答,随时在线为你解决问题

























| |---|---java.lang.Error |---|---|---java.lang.LinkageError |---|---|---|---java.lang.ExceptionInInitializerError public class ExceptionInInitializerError extends LinkageError |
As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "saved throwable object" that may be provided at construction time and accessed via the getException() method is now known as the cause, and may be accessed via the Throwable#getCause() method, as well as the aforementioned "legacy method."
Since:
JDK1.1Constructor | Description |
|---|---|
Constructs an ExceptionInInitializerError with null as its detail message string and with no saved throwable object. | |
Constructs an ExceptionInInitializerError with the specified detail message string. | |
ExceptionInInitializerError(Throwable thrown) | Constructs a new ExceptionInInitializerError class by saving a reference to the Throwable object thrown for later retrieval by the getException() method. |
Modifier and Type | Method | Description |
|---|---|---|
getCause() | Returns the cause of this error (the exception that occurred during a static initialization that caused this error to be created). | |
getException() | Returns the exception that occurred during a static initialization that caused this error to be created. |
Methods inherited from class java.lang.Throwable |
|---|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
public ExceptionInInitializerError()
Constructs an ExceptionInInitializerError with null as its detail message string and with no saved throwable object. A detail message is a String that describes this particular exception.public ExceptionInInitializerError(Throwable thrown)
Constructs a new ExceptionInInitializerError class by saving a reference to the Throwable object thrown for later retrieval by the getException() method. The detail message string is set to null.Parameters:
Parameter Name | Parameter Description |
|---|---|
thrown | The exception thrown |
public ExceptionInInitializerError(String s)
Constructs an ExceptionInInitializerError with the specified detail message string. A detail message is a String that describes this particular exception. The detail message string is saved for later retrieval by the Throwable#getMessage() method. There is no saved throwable object.Parameters:
Parameter Name | Parameter Description |
|---|---|
s | the detail message |
public Throwable getException()
Returns the exception that occurred during a static initialization that caused this error to be created.This method predates the general-purpose exception chaining facility. The Throwable#getCause() method is now the preferred means of obtaining this information.
Returns:
the saved throwable object of this ExceptionInInitializerError, or null if this ExceptionInInitializerError has no saved throwable object.
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功