java.lang.RuntimeException
java.lang.Exception
java.lang.ArithmeticException,
java.lang.ArrayStoreException,
java.lang.ClassCastException,
java.lang.IllegalArgumentException,
java.lang.IllegalMonitorStateException,
java.lang.IllegalStateException,
java.lang.IndexOutOfBoundsException,
java.lang.NegativeArraySizeException,
java.lang.NullPointerException,
java.lang.SecurityException,
java.util.EmptyStackException,
java.util.MissingResourceException,
java.util.NoSuchElementException
None
JDK 1.0 or later
The RuntimeException class is the superclass of the standard run-time exceptions that can be thrown in Java. The appropriate subclass of RuntimeException is thrown in response to a run-time error detected at the virtual machine level. A run-time exception represents a run-time condition that can occur generally in any Java method, so a method is not required to declare that it throws any of the run-time exceptions.
A Java program should try to handle all of the standard run-time exception classes, since they represent routine abnormal conditions that should be anticipated and caught to prevent program termination.
public class java.lang.RuntimeException extends java.lang.Exception { // Constructors public RuntimeException(); public RuntimeException(String s); }
This constructor creates a RuntimeException with no associated detail message.
The detail message.
This constructor creates a RuntimeException with the specified detail message.
Method |
Inherited From |
Method |
Inherited From |
---|---|---|---|
clone() |
Object |
equals(Object) |
Object |
fillInStackTrace() |
Throwable |
finalize() |
Object |
getClass() |
Object |
getLocalizedMessage() |
Throwable |
getMessage() |
Throwable |
hashCode() |
Object |
notify() |
Object |
notifyAll() |
Object |
printStackTrace() |
Throwable |
printStackTrace(PrintStream) |
Throwable |
printStackTrace(PrintWriter) |
Throwable |
toString() |
Object |
wait() |
Object |
wait(long) |
Object |
wait(long, int) |
Object |
ArithmeticException, ArrayStoreException, ClassCastException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalStateException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, SecurityException, Throwable