Skip to main content

Posts

Showing posts from January 11, 2021

Java API support for Exception Handling

First of all, please read below blog post to understand basics of Exception Handling in java. Exception handling and java keywords To continue from there, Basically Java default API has hierarchy of  java classes to support different uses cases of exceptions.  The parent class of all Exceptions and Errors is Throwable . Please check below pictorial representation of  API Hierarchy. Exception: The class Exception and any subclasses that are also not subclasses of RuntimeException are checked exceptions. And all subclasses of RuntimeException and RuntimeException class itself are Unchecked exception . Rest all are Checked exceptions Examples of Unchecked Exceptions:            ArrayIndexOutOfBoundException          NullPointerException Error: An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. Examples: T...