public class ExceptionInInitializerError extends LinkageError
ExceptionInInitializerError
是抛出一个静态初始化或静态变量的初始化评价期间发生异常。
在1.4版本中,该异常已被更新以符合通用异常链机制。“保存Throwable对象”,可在施工时提供的并经getException()
方法访问现在被称为零原因,可通过Throwable.getCause()
方法访问,以及前述的“传统方法”。
Constructor and Description |
---|
ExceptionInInitializerError()
构建一个
ExceptionInInitializerError
null 其详细信息的字符串并没有保存Throwable对象。
|
ExceptionInInitializerError(String s)
构建指定详细信息的字符串exceptionininitializererror。
|
ExceptionInInitializerError(Throwable thrown)
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
返回此错误的原因(在一个静态初始化过程中发生的异常,导致此错误被创建)。
|
Throwable |
getException()
返回在一个静态初始化过程中发生的异常,导致此错误被创建。
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ExceptionInInitializerError()
ExceptionInInitializerError
null
其详细信息的字符串并没有保存Throwable对象。一个详细信息是一个字符串,该字符串描述了这个特殊的异常。
public ExceptionInInitializerError(Throwable thrown)
thrown
-抛出的异常
public ExceptionInInitializerError(String s)
Throwable.getMessage()
方法检索。没有保存Throwable对象。
s
-详细信息
public Throwable getException()
这种方法在通用异常链设施。现在的Throwable.getCause()
方法获取这一信息的首选方式。
ExceptionInInitializerError
Throwable对象,或
null
如果这
ExceptionInInitializerError
没有保存Throwable对象。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.