Choosing access modifiers for a class
Marks a class member as public (name), protected (_name) or private (__name), so the class exposes only what other code needs.
Understanding Choosing access modifiers for a class in VCE Software Development U4O1
What it does: A method with no underscore is public, so it forms part of the interface that other code uses. A helper used only inside the class should be private (__name), so the class exposes only what other code needs. Good design exposes a small public interface and hides the rest. This reduces bugs and makes the class easier to maintain. Public members have no leading underscore. A leading double underscore makes the member private.
Common mistakes: The cash is internal data, so it should be private with two underscores: __cash = 0. The single underscore makes it protected, and it no longer matches self.__cash in add(). open() is part of the public interface that other code calls, so it must have no underscores: def open(self). Making it private means d.open() fails.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 82–114) and word search (Modules 3–114).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
access modifierFill in the Blanks
Spot the Error
Student with a class code? Join your class →