Skip to main content

Practice · 3 of 3

Trace the greeting chain

CHALLENGE
Difficulty: advanced+25 XP

Trace this hierarchy and call sequence **on paper**, then return the exact printed text (lines joined with |): ``java public class Greeter { public String greet() { return "Hello"; } public String greetAll() { return greet() + "!"; } } public class Loud extends Greeter { public String greet() { return "HELLO"; } } ` Calls: new Greeter().greetAll(), then new Loud().greetAll(). greetAll` is NOT overridden — but it still dispatches.

Back to lesson: Practice: Polymorphism gauntlet