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); } }
š² Practice Offline on Mobile: Download the free QA Automation & SDET Prep app on Google Play & App Store.