Name
RuntimeException
Synopsis
This
exception type is not used directly, but serves as a superclass of a
group of run-time exceptions that need not be declared in the
throws
clause of a method definition. These
exceptions need not be declared because they are runtime conditions
that can generally occur in any Java method. Thus, declaring them
would be unduly burdensome, and Java does not require it.
This class inherits methods from Throwable
but
declares none of its own. Each of the
RuntimeException
constructors simply invokes the
corresponding Exception( )
and Throwable(
)
constructor. See Throwable
for
details.
Figure 10-52. java.lang.RuntimeException
public class RuntimeException extends Exception { // Public Constructors public RuntimeException( ); 1.4 public RuntimeException(Throwable cause); public RuntimeException(String message); 1.4 public RuntimeException(String message, Throwable cause); }
Subclasses
Too many classes to list.
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.