Catching exception using class exception - java


Question:

Catching Exception Using Class Exception - Java

Write a program that demonstrates how various exceptions are caught with

catch (Exception exception)

This time, define classes ExceptionA (which inherits from class Exception) and ExceptionB (which inherits from class ExceptionA). In your program, create try blocks that throw exceptions of types ExceptionA, ExceptionB, NullPointerException and IOException. All exceptions should be caught with catch blocks specifying type Exception.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Catching exception using class exception - java
Reference No:- TGS01935987

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)