java.lang.Error
java.lang.Throwable
java.awt.AWTError, java.lang.LinkageError,
java.lang.ThreadDeath,
java.lang.VirtualMachineError
None
JDK 1.0 or later
The Error class is the superclass of all of the standard error classes that can be thrown in Java. The subclasses of Error are normally thrown by the class loader, the virtual machine, or other support code. Application-specific code should not normally throw any of the standard error classes.
An Error or one of its subclasses is typically thrown when an unpredictable run-time error, such as running out of memory, occurs. Because of the unpredictable nature of the events that cause errors to be thrown, a method does not have to declare the Error class or any of its subclasses in the throws clause of its method declaration.
A Java program should not try to handle the standard error classes. Most of these error classes represent nonrecoverable errors and as such, they cause the Java run-time system to print an error message and terminate program execution.
public class java.lang.Error extends java.lang.Throwable { // Constructors public Error(); public Error(String s); }
This constructor creates an Error with no associated detail message.
The detail message.
This constructor creates an Error 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 |
LinkageError, ThreadDeath, Throwable, VirtualMachineError