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.1Static vs non-static
Back to Computer Science HL Topics
7.1.34 min read

Static vs non-static (Computer Science HL)

IB Computer Science • Unit 7

Exam preparation

Practice the questions examiners actually ask

Our question bank mirrors real IB exam papers. Practice under timed conditions and track your progress across topics.

Start Practicing

Contents

  • Belonging to the object, or to the class
  • The distinction in code
  • Static methods, and scope
  • Exam-style question
The big idea: A non-static (instance) variable belongs to each object — every object has its own copy.

A static (class) variable belongs to the class itself — there is exactly one copy, however many objects exist.

Step to 'Static': one shared count, and three objects each with their own title.

Interactive diagram

Explore the labelled diagram, charts and maps for this topic in full study mode.

Claim your free topic

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

Instance (non-static)

  • One copy per object
  • Reached through the object: b1.title
  • Holds what makes this object different from the others
  • Created when the object is, destroyed with it
  • The default choice

Static (class)

  • One copy for the whole class
  • Reached through the class: Book.count
  • Holds what is true of all objects, or counts them
  • Exists even when no objects have been created
  • Use only when the value genuinely belongs to the class
A counter must be static: "How many Books have been created?" cannot be an instance variable — each object would hold its own count of 1.

The answer belongs to the class, because it is about the class, not about any one book.

Study smarter, not longer

Most students waste 40% of study time on topics they already know. Our AI tracks your progress and optimizes every minute.

Try Smart Study FreeYour first topic is free to keep • No credit card required
1

An instance method uses the object

2

A static method does not

3

Static cannot reach instance data

4

When to use each

Shared means shared: Changing a static variable changes it for every object at once, including ones created later.

That is the point when it is a counter — and a source of surprising bugs when it was meant to be per-object.

How this is tested — you must justify each choice from whether the value belongs to one object or to all. It comes up two ways:

Paper 2 — working with code

  • Distinguish static from non-static, 3-5 marks
  • Choose which a stated variable should be
  • Say why a static method cannot use instance data

Paper 2 — the algorithmic-thinking question

  • Reason about shared values with no code shown
  • Explain the effect of changing a class variable
The classic trap: Making something static because it feels like a shared setting. Ask: would every object have the same value, always? If not, it must be an instance variable.
IB-style questionDistinguish[5 marks]

A BankAccount class holds an account balance and the bank's current interest rate, and must count how many accounts exist. Decide static or non-static for each, with reasons.

Model answer plan

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

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Static vs non-static. Write your answer and get instant AI feedback — just like a real IB examiner.

whether a method returning a student's age should be static, and your answer. [2 marks]

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.4Classes and objects
7.1.5Encapsulation
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.2Designing classes
Next
Classes and objects7.1.4

21 practice questions on Static vs non-static

Students who practiced this topic on Aimnova scored 82% on average. Try free practice questions and get instant AI feedback.

Try 3 Free QuestionsView All Computer Science HL Topics