Practice Flashcards
Flip to reveal answersWhat is inheritance?
Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.
All 5 Flashcards — Inheritance
Sign up free to track progress and get spaced-repetition review schedules.
Question
What is inheritance?
Answer
Defining a class as a **specialised version** of another, taking its attributes and methods and adding its own.
Question
Inheritance or composition — how do you choose?
Answer
Say it aloud. "A SavingsAccount **is an** Account" → inheritance. "A Car **has an** Engine" → composition.
Question
What does super() do?
Answer
Calls the **parent's** version — usually the constructor, which sets the inherited attributes. Without it those attributes are never set.
Question
What is overriding?
Answer
A child class **redefining** a parent's method. Its version is used for objects of that class only.
Question
Why is inheritance the tightest coupling in OOP?
Answer
A child depends on the parent's **internals**, not just its interface, so one change to the parent can break every subclass at once.
Read the notes
Full study notes for Inheritance
Topic 7.2 hub
OOP: multiple classes
More from Topic 7.2
All flashcards in this topic
Computer Science exam skills
Paper structures & tips
Track your progress with spaced repetition
Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.
Start Free