Question: JAVA: Write a complete program to demonstrate the following. Create a hierarchy where concrete class B, abstract class C and concrete class D each extend
JAVA: Write a complete program to demonstrate the following. Create a hierarchy where concrete class B, abstract class C and concrete class D each extend abstract class A. Abstract class A has an abstract method (with no arguments) named print(). Concrete class E extends C, and concrete class F extends D. Both C and F implement interface I. Assume simple yet meaningful fields and/or methods for the classes and the interface. Show the creation of two objects of type I in your main() and call, from within main, a static void method named sm with those two I objects passed as parameters. The method sm should print some field of each of the two parameters.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
