Question: practice exception handling via catching or throwing the exception. Recall that we catch exceptions via surrounding the exception with a try/catch block. If we cannot
practice exception handling via catching or throwing the exception.
Recall that we catch exceptions via surrounding the exception with a try/catch block.
If we cannot catch the exception then we need to throw it to the caller by instantiating a new Throwable object using the throws keyword. Then specifying in the method signature what type of exception the method throws.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
