1.

What Things Should Be Kept In Mind While Creating Your Own Exceptions In Java?

Answer»

While creating your own EXCEPTION

  • All exceptions must be a child of Throwable.
  • If you WANT to write a checked exception that is automatically enforced by the Handle or Declare RULE, you NEED to extend the Exception CLASS.
  • You want to write a runtime exception, you need to extend the RuntimeException class.

While creating your own exception −



Discussion

No Comment Found