H.5 Java Exception Hierarchy
All Java exception classes inherit directly or indirectly from class Exception
, forming an inheritance hierarchy. You can extend this hierarchy with your own exception classes. Class Throwable
(a subclass of Object
) is the superclass of class Exception
. Only Throwable
objects can be used with the exception-handling mechanism. Class Throwable
has two subclasses: Exception
and Error
. Class Exception
and its subclasses—for instance, RuntimeException
(package java.lang
) and IOException
(package java.io
)—represent exceptional situations that can occur in a Java program and that can be caught by the application. Class Error
and its subclasses represent abnormal situations that happen in the JVM. Most Error
s happen infrequently ...
Get Android How to Program, 3/e 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.