Fiveable
Fiveable

Consider the code below. If we create an object of the B class and call the `printMessage()` method on that object, what will be the output? ```java class B { void printMessage() { super.printMessage(); System.out.println("Hello from B"); } } class A extends B { void printMessage() { System.out.println("Hello from A"); } } ```




© 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.