Name

Exception

Synopsis

This class forms the root of the exception hierarchy in Java. An Exception signals an abnormal condition that must be specially handled to prevent program termination. Exceptions may be caught and handled. An exception that is not a subclass of RuntimeException must be declared in the throws clause of any method that can throw it. This class inherits methods from Throwable but declares none of its own. Each of its constructors simply invokes the corresponding Throwable( ) constructor. See Throwable for details.

java.lang.Exception

Figure 10-21. java.lang.Exception

public class Exception extends Throwable {
// Public Constructors
     public Exception( );  
1.4  public Exception(Throwable cause);  
     public Exception(String message);  
1.4  public Exception(String message, Throwable cause);  
}

Subclasses

Too many classes to list.

Passed To

java.io.WriteAbortedException.WriteAbortedException( ), java.nio.charset.CoderMalfunctionError.CoderMalfunctionError( ), java.security.PrivilegedActionException.PrivilegedActionException( ), java.util.logging.ErrorManager.error( ), java.util.logging.Handler.reportError( ), javax.xml.parsers.FactoryConfigurationError.FactoryConfigurationError( ), javax.xml.transform.TransformerFactoryConfigurationError.TransformerFactoryConfigurationError( ), org.xml.sax.SAXException.SAXException( ), org.xml.sax.SAXParseException.SAXParseException( )

Returned By

java.security.PrivilegedActionException.getException( ...

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.