All exception types are subclasses of the built-in class Throwable.
Throwable has two subclasses:
1. Exception: This class is used for exceptional conditions that user programs should catch. This is also subclassed to create custom exception types. ArithmeticException is an example of such an error.
2. Error: This class defines exceptions that are not expected to be caught under normal circumstances by your program. Exceptions of type Error are used by the Java run-time system to indicate errors having to do with the run-time environment. Stack overflow is an example of such an error.
No comments:
Post a Comment