Programming Assignment 7
Ex 11.9 Write a program that shows that the order of catch blocks is important. If you try to catch a superclass exception type before a subclass type, the compiler should generate errors.
Ex 11.17 Use inheritance to create an exception superclass (called ExceptionA) and exception subclasses ExceptionB and ExceptionC, where ExceptionB inherits from ExceptionA and ExceptionC inherits from ExceptionB. Write a program to demonstrate that the catch block for type A ExceptionA catches exceptions of types ExceptionB and Exception C.
Ex 11.18 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 ExeptionA, ExceptionB, NullPointerException and IO Exception. All exceptions should be caught with catch blocks specifying type Exception.