One class, many objects
Each new Pet() makes a separate object from the same class. Every object has its own property values, but all of them share the same methods. Changing one object does not change the others.
Understanding One class, many objects in ACARA Digital Technologies Years 9–10
What it does: Both objects call the same speak method, but it uses this.name, so the output differs for each object. The Pet class is written once, and each new Pet() creates another object with different property values. A class is the template. The objects made with new are the actual things built from it. The method is shared, but this points to rex only, so only Rex's own age changes.
Common mistakes: JavaScript is case-sensitive, so new pet() does not match the class Pet. It should be new Pet("Rex"). The method name is misspelled. It must be constructor, otherwise it will not run each time new Pet() makes an object.
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 743–781) and word search (Modules 743–809).
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
new Pet()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →