aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 7.2Inheritance
Back to Computer Science HL Topics
7.2.14 min read

Inheritance (Computer Science HL)

IB Computer Science • Unit 7

Smart study tools

Turn reading into results

Move beyond passive notes. Answer real exam questions, get AI feedback, and build the skills that earn top marks.

Get Started Free

Contents

  • Define once, specialise after
  • The is-a test
  • Overriding, and how deep to go
  • Exam-style question
The big idea: Inheritance lets one class be defined as a specialised version of another. The child gets the parent's attributes and methods without repeating them, and adds what makes it different.

Write it once, change it in one place.
super() is not optional politeness: The parent's constructor is what sets the inherited attributes. Skip super().__init__ and the object exists with those attributes missing — a fault that appears far later, wherever one is first read.

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.
Start Studying Free Full access to Aimnova Pro · cancel anytime
Inheritance (is-a)Composition (has-a)
Reads asA SavingsAccount is an AccountA Car has an Engine
Child getsEverything the parent hasOnly what it asks the part to do
Change the parentEvery child is affectedOnly the direct user
Use whenThe child genuinely is a kind of the parentOne thing is built from another
Say the sentence out loud: "A Car is an Engine" is absurd, so inheritance is wrong there. "A SavingsAccount is an Account" is true, so it is right.

Inheriting for convenience — because a class happens to have methods you want — produces a hierarchy nobody can reason about.

What inheritance actually buys

  • Shared attributes defined once, so they cannot drift apart
  • A change to shared behaviour is one edit, not one per subclass
  • Children can be treated as the parent wherever the parent is expected
  • New kinds can be added without touching existing code

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.

Try AI Feedback FreeYour first topic is free to keep • No credit card required
1

Override

2

Extend rather than replace

3

Keep hierarchies shallow

4

Protected, not private

Inheritance is the tightest coupling there is: A child depends on the parent's internals, not just its interface. Changing the parent can break every subclass at once — which is why "prefer composition" is common advice, and why the is-a test matters.

How this is tested — you must justify inheritance with the is-a test AND with what duplication would cost. It comes up two ways:

Paper 2 — working with code

  • Explain inheritance and its purpose, 3-4 marks
  • Identify the parent class in a scenario
  • State what a child inherits

Paper 2 — the algorithmic-thinking question

  • Design a hierarchy and justify it
  • Explain why inheritance is wrong for a given pair
The classic trap: Naming the parent class and stopping. The marks are for why: the is-a relationship holds, and the shared attributes would otherwise be defined twice and drift apart.
IB-style questionConstruct[5 marks]

A library system handles Books and DVDs. Both have a title, an ID and a loan status; a Book also has an author and page count, a DVD a duration and certificate. Construct a class design and justify the use of inheritance.

Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic

IB Exam Questions on Inheritance

Practice with IB-style questions filtered to Topic 7.2.1. Get instant AI feedback on every answer.

Practice Topic 7.2.1 QuestionsBrowse All Computer Science HL Topics

How Inheritance Appears in IB Exams

Examiners use specific command terms when asking about this topic. Here's what to expect:

Define

Give the precise meaning of key terms related to Inheritance.

AO1
Describe

Give a detailed account of processes or features in Inheritance.

AO2
Explain

Give reasons WHY — cause and effect within Inheritance.

AO3
Evaluate

Weigh strengths AND limitations of approaches in Inheritance.

AO3
Discuss

Present arguments FOR and AGAINST with a balanced conclusion.

AO3

See the full IB Command Terms guide →

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

7.1.1Fundamentals of OOP
7.1.2Designing classes
7.1.3Static vs non-static
7.1.4Classes and objects
View all Computer Science HL topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science HL

Previous
7.1.5Encapsulation
Next
Polymorphism7.2.2

Don’t just read about Inheritance — practice it

Apply what you learned with real exam-style questions. AI feedback shows exactly how to improve your answers.

Practice NowView All Computer Science HL Topics