When an inherited method calls an overridden one.
Polymorphism in disguise: a method defined in the superclass can still end up running the subclass's version of a helper.
A subtle but powerful Java behavior: when a method inherited from a superclass calls another method (say, computeArea), Java looks up that called method on the actual object type, not the type that defined the caller.
If the subclass overrides computeArea, the inherited method ends up calling the subclass's version — even though the subclass never rewrote the caller itself.
On the AP exam, this is the heart of polymorphic-dispatch MCQs and is essential for understanding how Template Method-style designs work in AP-style class FRQs.
Method dispatch follows the actual object.
Even calls from inside the parent class find the child's override.
The setup
public class Shape {
public double area() { return 0; }
public String describe() {
return "This shape has area " + area();
}
}
public class Circle extends Shape {
private double radius;
public Circle(double r) { this.radius = r; }
@Override
public double area() {
return Math.PI * radius * radius;
}
}
Circle does NOT override describe() — only area().
What happens when you call describe on a Circle?
Circle c = new Circle(2);
System.out.println(c.describe());
// "This shape has area 12.566370614359172"
The inherited describe() runs (from Shape), but inside it, area() dispatches to Circle's version — because the actual object is a Circle.
Why this matters
The superclass doesn't need to know about its subclasses. As long as it calls an overridable method, subclasses can customize the behavior without rewriting the calling method.
Dispatch vocabulary.
Used in any polymorphism MCQ.
- Dynamic dispatch — Java decides which method to call based on the actual object's type at runtime.
- Inherited caller — a method the subclass uses without rewriting.
- Overridden callee — a method the subclass has rewritten.
- Actual type — the class of the object created with
new. - Declared type — the type of the reference variable.
- Template method — pattern where the parent calls overridable helpers.
How inherited callers are tested.
Dynamic dispatch is the dominant trap.
- "What does this print?" When a Shape variable references a Circle, calls to area resolve to Circle.
- "Which method is called?" The override on the actual object, not the inherited version.
- "Why doesn't describe need to be overridden?" Because it calls area, which IS overridden.
Trace inherited describe with overridden area.
Follow the dispatch path.
Setup. Shape has area() returning 0 and describe() returning "...area " + area(). Circle overrides area() to return πr².
Call: new Circle(3).describe().
Step 1. Circle has no describe() — Java looks up the chain and finds Shape's version.
Step 2. Shape's describe() runs. It calls area().
Step 3. Java checks the actual object's type: Circle. Circle has an override of area() — that's what runs.
Step 4. Circle's area() returns π * 9 ≈ 28.27.
Answer: "This shape has area 28.274333882308138".
Why this matters. The Shape author didn't need to know Circle existed. As long as area is declared in Shape and overridable, subclasses customize behavior automatically.
Dispatch pitfalls.
Most assume Java looks up methods by declared type.
- Assuming the parent's area is called. Java looks at the object, not the calling method's location.
- Confusing reference type with object type. A Shape variable can hold a Circle; the object decides dispatch.
- Trying to override describe redundantly. If only area changes, only override area.
- Returning the wrong type from the override. Signature must match.
Dispatch decision table.
Java picks based on the object.
Dispatch Reference
AP Quick Reference| Call site | Subclass override exists? | Which runs |
|---|---|---|
| From client code | Yes | Subclass version. |
| From client code | No | Inherited version. |
| From inside the parent | Yes | Subclass version (!). |
| From inside the parent | No | Parent's own version. |
How to master inherited dispatch.
Always ask: "What's the actual object?"
- MCQ Practice — for any method call, identify the actual object's class first; that drives the dispatch.
- Java Lab — set up Shape with describe; create Circle with overridden area. Print describe() output.
- FRQ Practice — leverage this pattern: when the parent calls overridable helpers, subclasses customize behavior cleanly.
Practice — attempt these now.
AP-style assessments aligned to this lesson. Time them.
AP CSA Unit 08 Topic 02 Override with Inherited Caller FRQ Practice
AP-style topic practice assessment