01
Overview

Override a method by adding to the superclass's result.

The cleanest reuse pattern: ask the superclass for its answer, then extend it with subclass-specific logic.

One of the most common override patterns in AP CSA: a subclass overrides a method that returns a value, calls super.method() to get the parent's result, and then adds to or modifies that result before returning.

This pattern keeps subclass code DRY — you reuse the superclass logic instead of duplicating it — and remains correct even if the superclass implementation later changes.

On the AP exam, this is the dominant inheritance pattern in FRQ #3 and #4 of inheritance-style problems.

02
Core Concept

Call super.method(); modify the returned value.

Reuse the parent's logic; add the subclass's twist.

The template

public class Subclass extends Superclass {
    @Override
    public ReturnType method(args) {
        ReturnType base = super.method(args);
        // modify or extend base
        return base + subclassExtra;
    }
}

Concrete example

public class Employee {
    private double base;
    public Employee(double base) { this.base = base; }
    public double getSalary() { return base; }
}

public class Manager extends Employee {
    private double bonus;
    public Manager(double base, double bonus) {
        super(base);
        this.bonus = bonus;
    }
    @Override
    public double getSalary() {
        return super.getSalary() + bonus;
    }
}

Manager.getSalary() reuses the Employee logic for the base salary and adds the manager-specific bonus. If the Employee class later adds tax handling, the Manager picks it up automatically.

Why not just access fields directly?

In AP CSA, superclass instance variables are private — the subclass cannot read them directly. super.getSalary() goes through the public accessor and respects encapsulation.

03
Key Vocabulary

Vocabulary for additive overrides.

Used in inheritance FRQs.

Vocabulary
  • Override — a subclass method that replaces an inherited one.
  • super.method() — call to the superclass version of the method.
  • Additive override — override that builds on the superclass's result.
  • @Override — annotation marking a method as overriding a parent.
  • Encapsulation — accessing fields through accessors rather than directly.
  • Reuse — keeping superclass logic available in the subclass.
04
AP Exam Focus

How additive overrides are tested.

Calling super and respecting encapsulation are the dominant rubric items.

Exam Focus

What FRQ graders check:

  • Call super.method() rather than duplicating logic.
  • Exact return type match with superclass signature.
  • Modify the result based on subclass fields.
  • Don't access private superclass fields directly. Use accessors.

MCQ patterns: trace the return value when called on a subclass; identify which version of the method runs.

05
Worked Example

Trace a Manager's salary calculation.

Inheritance flow + bonus addition.

Worked Example AP-style reasoning

Problem. Using the Employee/Manager classes above, what does m.getSalary() return when m = new Manager(50000, 10000)?

Step 1. Constructor: super(50000) sets base = 50000; then bonus = 10000.

Step 2. m.getSalary() calls the Manager version.

Step 3. Inside: super.getSalary() returns 50000.

Step 4. Add bonus: 50000 + 10000 = 60000.

Answer: 60000.

Why this matters. If Employee's getSalary() later added a tax adjustment, the Manager would automatically incorporate it — that's the value of additive overrides over copy-paste.

06
Common Mistakes

Additive-override pitfalls.

Most break encapsulation or duplicate logic.

Watch Out
  • Accessing the superclass field directly. this.base doesn't compile if base is private in Employee.
  • Duplicating the superclass logic. Copy-paste breaks DRY and stays broken if the parent changes.
  • Forgetting super. getSalary() + bonus calls the Manager method again — infinite recursion.
  • Wrong return type. Must match the superclass signature exactly.
  • Forgetting to call super in the constructor. Required when the superclass has no no-arg constructor.
07
Reference Table

Additive override at a glance.

Three-line pattern.

Additive Override Reference

AP Quick Reference
StepActionAP Tip
1Call super.method()Reuses parent logic.
2Compute subclass extraUsing subclass fields.
3Combine and returnMatch parent's return type.
EncapsulationDon't touch private fieldsUse accessors.
08
Practice Tip

How to master additive overrides.

Use super; never duplicate.

Practice Strategy
  • MCQ Practice — for each option, check whether super.method() is called. Duplicated logic is a red flag.
  • Java Lab — build Employee/Manager, Vehicle/Truck. Override accessors that add subclass fields.
  • FRQ Practice — write the three-line pattern: super, add, return.
09
Section · 09

Practice — attempt these now.

AP-style assessments aligned to this lesson. Time them.

FRQ Practice 30 min 18 marks Pending

AP CSA Unit 08 Topic 01 Override Adding to Superclass Result FRQ Practice

AP-style topic practice assessment

Start