public class RuntimeException extends 异常
RuntimeException是例外,可以把java虚拟机正常运行时的类。
RuntimeException及其子类是未检查的异常。未检查的异常不需要在方法或构造函数的throws条款宣称如果他们可以采用的方法或构造函数的执行和宣传外抛的方法或构造函数的边界。
| Modifier | Constructor and Description |
|---|---|
|
RuntimeException()
提出了一种新的
null运行时异常的详细信息。
|
|
RuntimeException(String message)
用指定的详细信息构造一个新的运行时异常。
|
|
RuntimeException(String message, Throwable cause)
用指定的详细信息构造一个新的运行时异常。
|
protected |
RuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
构建了一种新的指定详细信息,运行时异常原因,抑制启用或禁用,启用或禁用写的堆栈跟踪。
|
|
RuntimeException(Throwable cause)
提出了一种新的指定的原因和
(cause==null ? null : cause.toString())详细信息运行时异常(通常包含
cause类和详细信息)。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic RuntimeException()
null运行时异常的详细信息。原因是没有初始化,初始化,随后可通过调用
Throwable.initCause(java.lang.Throwable)。
public RuntimeException(String message)
Throwable.initCause(java.lang.Throwable)。
message -详细信息。的详细信息保存为以后的
Throwable.getMessage()方法检索。
public RuntimeException(String message, Throwable cause)
值得注意的是,与cause详细消息为空不自动纳入这个运行时异常的详细信息。
message的详细信息(这是以后的
Throwable.getMessage()方法检索)。
cause的原因(这是以后的
Throwable.getCause()方法检索)。(一
null值是允许的,并指出原因是不存在的或未知的。)
public RuntimeException(Throwable cause)
cause的原因(这是以后的
Throwable.getCause()方法检索)。(一
null值是允许的,并指出原因是不存在的或未知的。)
protected RuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
message -详细信息。
cause的原因。(一
null值是允许的,并指出原因是不存在的或未知的。)
enableSuppression是否抑制是启用或禁用
writableStackTrace是否应该写入堆栈跟踪
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.