Given the following code: ``` class A { public void display() { System.out.print("A"); } } class B extends A { public void display() { System.out.print("B"); } } class C extends B { public void display() { System.out.print("C"); } } ``` What will be the output when the following code is executed? ``` B obj1 = new C(); C obj2 = new C(); A obj3 = new C(); obj1.display(); obj2.display(); obj3.display(); ```




© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.