Question
Hello can I get some helpw ith the assignment below please? ----------------------------------------------------------------------------------------------------------------------------------------------- // Test1.java // Catching subclass exceptions public class Test1 { // The header
Hello can I get some helpw ith the assignment below please?
-----------------------------------------------------------------------------------------------------------------------------------------------
// Test1.java // Catching subclass exceptions
public class Test1 {
// The header of your executing main method goes here.
{
// Place your two try-catch blocks here. }
} // end class Test1
// Place your exception subclasses (with empty bodies) here.
---------------------------------------------------------------------------------------------------------------------------------
// place an import statement here to catch input/output exceptions.
public class Test2 {
// The header of your executing main method goes here.
{
// Place your four try-catch blocks here.
}
} // end class Test1
// Place your two subclasses (with empty bodies) here.
Module 4.3 | Challenge Exception Hierarchies Overview In the first part of this challenge, you will write a program that demonstrates that an exception superclass will catch exceptions of exceptions thrown by its exception subclasses. In the second part of this challenge, you will write another program that demonstrates how exceptions are caught with catch (Exception exception). Each of these skeleton application programs run independently of each other Specifications Part A . Use inheritance to create an exception superclass (called ExceptionA) ExceptionA and exception subclasses ExceptionB and ExceptionC. Refer to the diagram (right) . Each of these classes may be written with an empty class body. ExceptionB Write an application named Testl with these classes included Demonstrate that the catch block for type ExceptionA catches exceptions of ExceptionB and ExceptionC. Sample output is shown below ExceptionC Part B Reuse your code from Part A for these classes o ExceptionA (which inherits from Exception) o ExceptionB (which inherits from ExceptionA) Write an application named Test2 with these classes included Create try blocks that throw exceptions of types: o ExceptionA o ExceptionB o NullPointerException o IOExceptiorn . Write a catch block for each try block specifying type Exception. . Sample output is shown below Additional Requirements .Follow the Basic Coding Standards. Include a comment section at the top of your program with your student ID, name, and title of the programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started