Question
How to create custom exceptions?
Answer
By extending the Exception class or one of its subclasses. Example:
class MyException extends Exception { public MyException() { super(); } public MyException(String s) { super(s); } }
How to create custom exceptions?
By extending the Exception class or one of its subclasses. Example:
class MyException extends Exception { public MyException() { super(); } public MyException(String s) { super(s); } }