IB Computer Science HL · Year 2 · Lesson 16

Inheritance

Multiple-class OOP adds relationships and flexible behaviour through inheritance, polymorphism, abstraction, composition and patterns.

Paper 250 minutesB3.2.1
Today’s targets

What you need to be able to do

2 / 8
  • Explain + applyAnd apply the concept of inheritance in OOP to promote code reusability
B3.2.1
Paper 2 lensMatch the depth of every response to the command term. Previously learned content can move quickly, but retrieval must still be accurate.
Retrieve

Rapid Recall Deck

3 / 8

Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.

  • What is inheritance in OOP?: A mechanism where a child/subclass derives state or behaviour from a parent/superclass and can extend or specialize it.
  • What relationship does inheritance usually model?: An 'is-a' hierarchical relationship, such as ElectricCar is a Car.
  • How does inheritance promote code reuse?: Common functionality can be defined once in a parent class and inherited by multiple child classes.
  • How can a child class extend a parent class?: It can add new members and may override inherited behaviour where the language permits.
  • How do access modifiers affect inheritance?: Public/protected members are generally accessible according to the language's rules; private parent members are not directly accessible from the child class.
  • When is inheritance a poor design choice?: When the relationship is not genuinely hierarchical or when reuse would create tight coupling between classes that should remain independent.
B3.2.1 · Learn

Core knowledge and application

4 / 8
B3.2.1Explain + apply

And apply the concept of inheritance in OOP to promote code reusability

Multiple-class OOP adds relationships and flexible behaviour through inheritance, polymorphism, abstraction, composition and patterns.

Exam moveGive the mechanism or relationship and make the reasons/causes explicit.
Required detail 1How inheritance enables a hierarchical relationship between parent and child classes
Required detail 2Extending existing classes, utilizing inheritance to reuse and extend functionalities
Required detail 3The impact of inheritance on access to parent class members with different access modifiers (private, public, protected, default)
Assessment boundaryPaper 2

Explain it without notes

Explain + apply: And apply the concept of inheritance in OOP to promote code reusability in the context of a school platform with multiple interacting object types.

  • How inheritance enables a hierarchical relationship between parent and child classes
  • Extending existing classes, utilizing inheritance to reuse and extend functionalities
  • The impact of inheritance on access to parent class members with different access modifiers (private, public, protected, default)
Trace / construct

Programming checkpoint

5 / 8
class User:
    def __init__(self, name):
        self.name = name

class Student(User):
    def __init__(self, name, grade):
        super().__init__(name)
        self.grade = grade
Before you run itTrace the code by hand. Identify state changes, branch/loop behaviour, and the final result.

Modify it

Change one condition, input or operation so the program solves a slightly different problem. Predict the effect before editing.

Apply

Transfer to a new scenario

6 / 8
ScenarioA school platform with multiple interacting object types needs a design or technical decision related to today’s topic. Explain what matters and why.
  • How inheritance enables a hierarchical relationship between parent and child classes
  • Extending existing classes, utilizing inheritance to reuse and extend functionalities
Exam lens

Paper 2 practice

7 / 8
Build the response before checking notesUse precise terminology and match the required depth.
  1. Explain + apply: And apply the concept of inheritance in OOP to promote code reusability in the context of a school platform with multiple interacting object types.
Self-checkAnswer the exact command term. For explain, include mechanism/reason; for compare, pair criteria; for discuss/evaluate/justify, build supported reasoning and a conclusion.
Homework

Finish the learning cycle

8 / 8

IA — main task

Continue Criterion D development. Keep code readable, record meaningful implementation decisions, and maintain testing/evidence notes as you work.

Syllabus — short

Complete one targeted Paper 2/Paper 1 retrieval task from today’s lesson.