B3.1 Fundamentals of OOP for a single classB3.1.3

Static vs Non-Static Variables and Methods

Distinguish between static and non-static variables and methods

SL + HL≈ 50 minCommand term: DistinguishPremium

In this lesson

  • Distinguishing instance (non-static) variables from static (class) variables
  • Distinguishing instance methods from static methods, and what each can access
  • Deciding when to use a static member instead of an instance member
  • Writing static variables, constants and methods in Java and Python

This lesson is part of Premium

Every topic has one free lesson. Premium unlocks every interactive lesson, the exam-style questions at the end of each one, and the rest of Praxis IB.

What's inside

  1. LearnWhose data is it?
  2. CodeA shared counter
  3. LabOne shared value, many objects
  4. LearnStatic and instance methods
  5. CodeStatic constants and utility methods
  6. LearnStatic members in UML
  7. CheckStatic or instance?
  8. CheckQuick check
  9. ExamWorked exam answer
  10. ReviewMistakes examiners see
  11. Exam practiceExam-style questions

Ends with 4 exam-style questions worth 10 marks, with a self-marking markscheme.