Tuesday, 17 November 2015

How to create Customized exception? When to make a custom checked or unchecked Exception

To create you own exception extend the Exception class or any of its subclasses.

If an application / developer can reasonably be expected to recover from an exception, make it a checked exception. If an application / developer cannot do anything to recover from the exception, make it an unchecked exception.
Example:

No comments:

Post a Comment