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.1
Unit 7 · Object-oriented programming · Topic 7.1

IB Computer Science HL — OOP: a single class

Fundamentals of OOP for a single class

Higher Level students should use this topic hub as a map: start with the shared sub-topics, then follow the HL-only extensions and exam-skill links where this topic asks for deeper analysis.

Exam technique guidePractice questions

Key concepts in OOP: a single class

Key Idea: Object-oriented programming builds a program from objects that hold their own data and the operations on it. That is what lets an object enforce its own rules, however the rest of the program uses it.

Paper 1

  • Define the four principles; identify a relationship.

Paper 2

  • Design classes for a scenario and justify the design.

Both

  • The justification carries the marks — say what the alternative would break.

🗝️ The vocabulary

TermMeaning
ClassThe definition — what attributes and methods objects of that kind have
ObjectOne instance, with its own values for those attributes
AttributeA piece of data an object holds
MethodAn operation an object can perform
ConstructorRuns when an object is created, setting it to a valid state
InstantiationCreating an object from a class

🏛️ The four principles

Learn the one-line definitions

  • Encapsulation — data kept private, reachable only through the class's own methods
  • Inheritance — one class defined as a specialised version of another, taking on its members
  • Polymorphism — objects of different classes responding to the same call in their own ways
  • Abstraction — exposing only the operations a user needs and hiding how they work
A Car HAS an Engine — that is association. A SavingsAccount IS a BankAccount — that is inheritance. Say the sentence aloud; if 'is a' sounds absurd, inheritance is the wrong tool.

⚙️ Static against non-static

StaticNon-static
Belongs toThe classEach object
CopiesOne, shared by every objectOne per object
CalledWithout any objectOn a particular object
Can use instance attributesNoYes

🔗 References and copies

Where this catches people out

  • A variable holds a reference to an object, not the object itself
  • Assigning it copies the reference — both variables then refer to one object
  • A shallow copy duplicates the attributes as they stand, so nested objects stay shared
  • A deep copy duplicates those too, so the objects share nothing
  • A null reference points at nothing; calling through it fails where the call is, not where the mistake was
Important: Returning a reference to a private list hands callers the real object — they can modify it directly, bypassing every rule the class enforces. Return a copy.

📝 Exam-style questions

IB-style questionExplain[4 marks]

A class Account keeps its balance private and offers deposit() and withdraw(). A developer proposes adding a public setBalance() method. Explain why this is a poor design decision.

🔒 Model answer plan

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

Claim your free topic →
IB-style questionConstruct[4 marks]

A gym has members and staff. Both have a name, an ID and a joining date. Members have a membership type; staff have a role and a salary. Construct a class design, justifying 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 →

✅ Quick check

Cover the answers.

Class or object — which is the definition? The class. An object is one instance created from it, with its own attribute values.

A Car and an Engine — inheritance or association? Association — a Car HAS an Engine. 'A Car is an Engine' is absurd, so inheritance is wrong.

What does a constructor guarantee? That an object starts in a valid state — its attributes are set before anything can use it.

Two variables are assigned the same object. One is modified. What does the other see? The change — both hold a reference to the same object, not to copies.

Why is 'private' not a security measure? It manages dependencies, not access to memory — the data sits there unencrypted and a debugger can read it.


Exam tips

  • Use the is-a test aloud before claiming inheritance.
  • Design questions want the JUSTIFICATION — say what the alternative would break.
  • Encapsulation: name the rule that a public setter would bypass.
  • Assignment copies the reference, not the object. Say so explicitly in trace questions.
  • A shallow copy leaves nested objects shared; a deep copy does not.
  • Static belongs to the class, non-static to the object. One copy against one per object.

What you'll learn in Topic 7.1

  • 7.1.1 Fundamentals of OOP
  • 7.1.2 Designing classes
  • 7.1.3 Static vs non-static
  • 7.1.4 Classes and objects
  • 7.1.5 Encapsulation
Suggested study order: Read the notes for each sub-topic below → test yourself with flashcards → attempt practice questions → review exam technique.

Study resources — 7.1 OOP: a single class

7.1.1

Fundamentals of OOP

Notes
7.1.2

Designing classes

Notes
7.1.3

Static vs non-static

Notes
7.1.4

Classes and objects

Notes
7.1.5

Encapsulation

Notes

Ready to study OOP: a single class?

Get expert practice questions with instant AI feedback, and a study planner tailored to your IB Computer Science HL exam date.

Start studying free

Topic 7.1 OOP: a single class forms a core part of Unit 7: Object-oriented programming in IB Computer Science HL. Mastering these concepts will strengthen your understanding of connected topics across the syllabus and prepare you for exam questions that require analysis, evaluation, and real-world application.

Previous topic
6.5 File processing
Next topic
7.2 OOP: multiple classes
All Computer Science HL topics
Exam technique

Ready to practice?

Get AI-graded practice questions, mock exams, flashcards, and a personalised study plan — all aligned to your IB syllabus.

Start Studying Free

No credit card required · No time limit