Back to Topic 7.2 — OOP: multiple classes
7.2.1Computer Science HL5 flashcards

Inheritance

Practice Flashcards

Flip to reveal answers
Card 1 of 57.2.1
7.2.1
Question

What is inheritance?

Click to reveal answer

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.

Card 1definition

Question

What is inheritance?

Answer

Defining a class as a **specialised version** of another, taking its attributes and methods and adding its own.

Card 2concept

Question

Inheritance or composition — how do you choose?

Answer

Say it aloud. "A SavingsAccount **is an** Account" → inheritance. "A Car **has an** Engine" → composition.

Card 3process

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.

Card 4definition

Question

What is overriding?

Answer

A child class **redefining** a parent's method. Its version is used for objects of that class only.

Card 5concept

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.

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