The big idea: Polymorphism means the same call does the right thing for whatever object it is made on.
Calling area() on a list of shapes gives each shape's own calculation — and the calling code never asks what kind of shape it holds.
The loop never asks what it is holding: No if isinstance and no type check anywhere. The object itself decides which method runs, which is the whole point — and why a new shape needs no change to this loop.
Free preview
This is the free notes preview
You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:
- FlashcardsLock in vocabulary and key terms with spaced repetition.
- Practice questionsAnswer exam-style questions and get instant AI marking.
- Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
- Personalised study planA daily plan built around your exam date and weak areas.
| Overriding | Overloading | |
|---|---|---|
| Also called | Run-time polymorphism | Compile-time polymorphism |
| Same method name in | Parent and child | One class |
| Differs by | Which class the object is | The parameters supplied |
| Decided | When the program runs | When it is compiled |
| Example | Circle.area() against Rectangle.area() | add(int, int) against add(double, double) |
These are routinely confused: Overriding replaces a parent's method in a child — same signature, different class. Overloading defines several methods with the same name and different parameters in the same class.
An answer that swaps them loses the mark even when the example is right.
Learn what examiners really want
See exactly what to write to score full marks. Our AI shows you model answers and the key phrases examiners look for.
Code that does not change
- A new subclass works with existing loops immediately
- No if-chain to extend, so no chance of forgetting one
- Adding behaviour without editing working code
One interface
- Callers learn one method name, not one per type
- The calling code reads as what it wants, not how each type does it
The alternative
- Without it: a long if the type is Circle … otherwise if it is Rectangle chain
- Every new type means editing every such chain
- And every one you miss is a silent bug
Name what it replaces: The strongest polymorphism answer says what the code would look like without it: a type-checking if-chain that must be found and extended everywhere a new type is added.
How this is tested — you must show the same call behaving differently AND explain what it saves. It comes up two ways:
Paper 2 — working with code
- Explain polymorphism, 3-4 marks
- Distinguish overriding from overloading
- State what a given call outputs
Paper 2 — the algorithmic-thinking question
- Construct classes demonstrating it
- Explain why it removes a type-checking chain
The classic trap: Describing inheritance and calling it polymorphism. Inheritance is sharing a method; polymorphism is the same call resolving differently per object. Show two different outputs from one line of code.
One unchanged call line reaching a different method as the object changes.
Interactive diagram
Explore the labelled diagram, charts and maps for this topic in full study mode.
A payments system handles CardPayment, BankTransfer and VoucherPayment, each processed differently. Explain how polymorphism lets one loop process a mixed list, and what it saves.
Model answer plan
See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.