Name
Exception
Synopsis
Exception
is the base class for Java language exceptions.
Exceptions represent non-fatal error conditions that applications may be
able to recover from. Exception
is derived from the
Throwable
class, which is also the parent of
Error
. However, exceptions derived from
Error
differ from those derived from
Exception
in that they represent conditions from which
application code would not usually be expected to recover.
Methods that throw Exception
s are required to include
a throws
clause in their declarations, except under
one condition: methods are not obliged to declare any exceptions that
derive from the RuntimeException
class. These types of
exceptions typically indicate a programming error that cannot be recovered
from.
This class is the same as its J2SE equivalent, apart from its inability to be serialized.
public class Exception extends Throwable { // Public Constructors public Exception(); public Exception( String s); }
Subclasses
java.io.IOException
, ClassNotFoundException
, IllegalAccessException
, InstantiationException
, InterruptedException
, RuntimeException
, javax.microedition.midlet.MIDletStateChangeException
, javax.microedition.rms.RecordStoreException
Get J2ME in a Nutshell 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.