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() {

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

1 Expert Approved Answer
Step: 1 Unlock

The detailed answer for the above question is provided below ANSWER NOTE Please save program named a... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!