Question: Consider the following class hierarchy: class ClassA{ public static void testClassMethod() { System.out.println(The static method in ClassA); } public void testInstanceMethod() { } System.out.println(The

Consider the following class hierarchy: class ClassA{ public static void testClassMethod() { System.out.println("The static method in ClassA"); } public void testInstanceMethod() { } System.out.println("The instance method in ClassA"); } class ClassB extends ClassA{ public static void test ClassMethod() { System.out.println("The static method in ClassB"); } public void testInstanceMethod() { } System.out.println("The instance method in ClassB"); } public class Main public static void main(String[] args) { Class B B = new ClassB (); ClassA A = B; A.testClass Method(); A.testInstance Method(); B.testClass Method(); B.testInstanceMethod(); } What is the output of this program? Explain your answer.
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided below ANSWER NOTE Please save program named a... View full answer
Get step-by-step solutions from verified subject matter experts
