java.lang
Class Exception

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
      extended by java.lang.Exception
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
AclNotFoundException sample code for java.security.acl.AclNotFoundException definition code for java.security.acl.AclNotFoundException , ActivationException sample code for java.rmi.activation.ActivationException definition code for java.rmi.activation.ActivationException , AlreadyBoundException sample code for java.rmi.AlreadyBoundException definition code for java.rmi.AlreadyBoundException , ApplicationException sample code for org.omg.CORBA.portable.ApplicationException definition code for org.omg.CORBA.portable.ApplicationException , AWTException sample code for java.awt.AWTException definition code for java.awt.AWTException , BackingStoreException sample code for java.util.prefs.BackingStoreException definition code for java.util.prefs.BackingStoreException , BadAttributeValueExpException sample code for javax.management.BadAttributeValueExpException definition code for javax.management.BadAttributeValueExpException , BadBinaryOpValueExpException sample code for javax.management.BadBinaryOpValueExpException definition code for javax.management.BadBinaryOpValueExpException , BadLocationException sample code for javax.swing.text.BadLocationException definition code for javax.swing.text.BadLocationException , BadStringOperationException sample code for javax.management.BadStringOperationException definition code for javax.management.BadStringOperationException , BrokenBarrierException sample code for java.util.concurrent.BrokenBarrierException definition code for java.util.concurrent.BrokenBarrierException , ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException , CloneNotSupportedException sample code for java.lang.CloneNotSupportedException definition code for java.lang.CloneNotSupportedException , DataFormatException sample code for java.util.zip.DataFormatException definition code for java.util.zip.DataFormatException , DatatypeConfigurationException sample code for javax.xml.datatype.DatatypeConfigurationException definition code for javax.xml.datatype.DatatypeConfigurationException , DestroyFailedException sample code for javax.security.auth.DestroyFailedException definition code for javax.security.auth.DestroyFailedException , ExecutionException sample code for java.util.concurrent.ExecutionException definition code for java.util.concurrent.ExecutionException , ExpandVetoException sample code for javax.swing.tree.ExpandVetoException definition code for javax.swing.tree.ExpandVetoException , FontFormatException sample code for java.awt.FontFormatException definition code for java.awt.FontFormatException , GeneralSecurityException sample code for java.security.GeneralSecurityException definition code for java.security.GeneralSecurityException , GSSException sample code for org.ietf.jgss.GSSException definition code for org.ietf.jgss.GSSException , IllegalAccessException sample code for java.lang.IllegalAccessException definition code for java.lang.IllegalAccessException , IllegalClassFormatException sample code for java.lang.instrument.IllegalClassFormatException definition code for java.lang.instrument.IllegalClassFormatException , InstantiationException sample code for java.lang.InstantiationException definition code for java.lang.InstantiationException , InterruptedException sample code for java.lang.InterruptedException definition code for java.lang.InterruptedException , IntrospectionException sample code for java.beans.IntrospectionException definition code for java.beans.IntrospectionException , InvalidApplicationException sample code for javax.management.InvalidApplicationException definition code for javax.management.InvalidApplicationException , InvalidMidiDataException sample code for javax.sound.midi.InvalidMidiDataException definition code for javax.sound.midi.InvalidMidiDataException , InvalidPreferencesFormatException sample code for java.util.prefs.InvalidPreferencesFormatException definition code for java.util.prefs.InvalidPreferencesFormatException , InvalidTargetObjectTypeException sample code for javax.management.modelmbean.InvalidTargetObjectTypeException definition code for javax.management.modelmbean.InvalidTargetObjectTypeException , InvocationTargetException sample code for java.lang.reflect.InvocationTargetException definition code for java.lang.reflect.InvocationTargetException , IOException sample code for java.io.IOException definition code for java.io.IOException , JMException sample code for javax.management.JMException definition code for javax.management.JMException , LastOwnerException sample code for java.security.acl.LastOwnerException definition code for java.security.acl.LastOwnerException , LineUnavailableException sample code for javax.sound.sampled.LineUnavailableException definition code for javax.sound.sampled.LineUnavailableException , MidiUnavailableException sample code for javax.sound.midi.MidiUnavailableException definition code for javax.sound.midi.MidiUnavailableException , MimeTypeParseException sample code for java.awt.datatransfer.MimeTypeParseException definition code for java.awt.datatransfer.MimeTypeParseException , NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException , NoninvertibleTransformException sample code for java.awt.geom.NoninvertibleTransformException definition code for java.awt.geom.NoninvertibleTransformException , NoSuchFieldException sample code for java.lang.NoSuchFieldException definition code for java.lang.NoSuchFieldException , NoSuchMethodException sample code for java.lang.NoSuchMethodException definition code for java.lang.NoSuchMethodException , NotBoundException sample code for java.rmi.NotBoundException definition code for java.rmi.NotBoundException , NotOwnerException sample code for java.security.acl.NotOwnerException definition code for java.security.acl.NotOwnerException , ParseException sample code for java.text.ParseException definition code for java.text.ParseException , ParserConfigurationException sample code for javax.xml.parsers.ParserConfigurationException definition code for javax.xml.parsers.ParserConfigurationException , PrinterException sample code for java.awt.print.PrinterException definition code for java.awt.print.PrinterException , PrintException sample code for javax.print.PrintException definition code for javax.print.PrintException , PrivilegedActionException sample code for java.security.PrivilegedActionException definition code for java.security.PrivilegedActionException , PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException , RefreshFailedException sample code for javax.security.auth.RefreshFailedException definition code for javax.security.auth.RefreshFailedException , RemarshalException sample code for org.omg.CORBA.portable.RemarshalException definition code for org.omg.CORBA.portable.RemarshalException , RuntimeException sample code for java.lang.RuntimeException definition code for java.lang.RuntimeException , SAXException sample code for org.xml.sax.SAXException definition code for org.xml.sax.SAXException , ServerNotActiveException sample code for java.rmi.server.ServerNotActiveException definition code for java.rmi.server.ServerNotActiveException , SQLException sample code for java.sql.SQLException definition code for java.sql.SQLException , TimeoutException sample code for java.util.concurrent.TimeoutException definition code for java.util.concurrent.TimeoutException , TooManyListenersException sample code for java.util.TooManyListenersException definition code for java.util.TooManyListenersException , TransformerException sample code for javax.xml.transform.TransformerException definition code for javax.xml.transform.TransformerException , UnmodifiableClassException sample code for java.lang.instrument.UnmodifiableClassException definition code for java.lang.instrument.UnmodifiableClassException , UnsupportedAudioFileException sample code for javax.sound.sampled.UnsupportedAudioFileException definition code for javax.sound.sampled.UnsupportedAudioFileException , UnsupportedCallbackException sample code for javax.security.auth.callback.UnsupportedCallbackException definition code for javax.security.auth.callback.UnsupportedCallbackException , UnsupportedFlavorException sample code for java.awt.datatransfer.UnsupportedFlavorException definition code for java.awt.datatransfer.UnsupportedFlavorException , UnsupportedLookAndFeelException sample code for javax.swing.UnsupportedLookAndFeelException definition code for javax.swing.UnsupportedLookAndFeelException , URISyntaxException sample code for java.net.URISyntaxException definition code for java.net.URISyntaxException , UserException sample code for org.omg.CORBA.UserException definition code for org.omg.CORBA.UserException , XMLParseException sample code for javax.management.modelmbean.XMLParseException definition code for javax.management.modelmbean.XMLParseException , XPathException sample code for javax.xml.xpath.XPathException definition code for javax.xml.xpath.XPathException

public class Exception
extends Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable

The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch.

Since:
JDK1.0
See Also:
Error sample code for java.lang.Error definition code for java.lang.Error , Serialized Form

Constructor Summary
Exception sample code for java.lang.Exception.Exception() definition code for java.lang.Exception.Exception() ()
          Constructs a new exception with null as its detail message.
Exception sample code for java.lang.Exception.Exception(java.lang.String) definition code for java.lang.Exception.Exception(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  message)
          Constructs a new exception with the specified detail message.
Exception sample code for java.lang.Exception.Exception(java.lang.String, java.lang.Throwable) definition code for java.lang.Exception.Exception(java.lang.String, java.lang.Throwable) (String sample code for java.lang.String definition code for java.lang.String  message, Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  cause)
          Constructs a new exception with the specified detail message and cause.
Exception sample code for java.lang.Exception.Exception(java.lang.Throwable) definition code for java.lang.Exception.Exception(java.lang.Throwable) (Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  cause)
          Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
 
Method Summary
 
Methods inherited from class java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable
fillInStackTrace sample code for java.lang.Throwable.fillInStackTrace() definition code for java.lang.Throwable.fillInStackTrace() , getCause sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() , getLocalizedMessage sample code for java.lang.Throwable.getLocalizedMessage() definition code for java.lang.Throwable.getLocalizedMessage() , getMessage sample code for java.lang.Throwable.getMessage() definition code for java.lang.Throwable.getMessage() , getStackTrace sample code for java.lang.Throwable.getStackTrace() definition code for java.lang.Throwable.getStackTrace() , initCause sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) , printStackTrace sample code for java.lang.Throwable.printStackTrace() definition code for java.lang.Throwable.printStackTrace() , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintStream) definition code for java.lang.Throwable.printStackTrace(java.io.PrintStream) , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) definition code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) , setStackTrace sample code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) definition code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) , toString sample code for java.lang.Throwable.toString() definition code for java.lang.Throwable.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

Exception sample code for java.lang.Exception() definition code for java.lang.Exception()

public Exception()
Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable) sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) .


Exception sample code for java.lang.Exception(java.lang.String) definition code for java.lang.Exception(java.lang.String)

public Exception(String sample code for java.lang.String definition code for java.lang.String  message)
Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable) sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) .

Parameters:
message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() sample code for java.lang.Throwable.getMessage() definition code for java.lang.Throwable.getMessage() method.

Exception sample code for java.lang.Exception(java.lang.String, java.lang.Throwable) definition code for java.lang.Exception(java.lang.String, java.lang.Throwable)

public Exception(String sample code for java.lang.String definition code for java.lang.String  message,
                 Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  cause)
Constructs a new exception with the specified detail message and cause.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() sample code for java.lang.Throwable.getMessage() definition code for java.lang.Throwable.getMessage() method).
cause - the cause (which is saved for later retrieval by the Throwable.getCause() sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Since:
1.4

Exception sample code for java.lang.Exception(java.lang.Throwable) definition code for java.lang.Exception(java.lang.Throwable)

public Exception(Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, PrivilegedActionException sample code for java.security.PrivilegedActionException definition code for java.security.PrivilegedActionException ).

Parameters:
cause - the cause (which is saved for later retrieval by the Throwable.getCause() sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Since:
1.4