← VCE Applied Computing U1O2

Abstraction in OOP

A class shows only the details needed to use it and hides the complicated working behind simple methods, so you can use a method without knowing how it works inside.

Understanding Abstraction in OOP in VCE Applied Computing U1O2

What it does: The program just calls get_speed() and uses the result, so the working inside the method stays hidden. A library program only needs title and author, so details like paper colour are left out. That is abstraction. Abstraction keeps the useful, simple parts visible and hides the complicated details inside the class. You can use a method by knowing what it does, not how it does it. That is abstraction. Calling a method by name and passing a value shows abstraction: you use the method without seeing its inner working.

Common mistakes: A method needs self as its first parameter so it can reach the object's data. The simple boil() method hides the working, so it must be def boil(self):. The value passed in must be stored in the object with self.fuel = fuel. The broken line reads the attribute before it exists, so the model of the car has no fuel.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

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 8–88) and word search (Modules 8–124).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement best describes abstraction in OOP?
A class shows every detail of how it works so users can change anythingA class shows only what is needed to use it and hides the complicated working
Matches
class Player: def __init__(self, name, shoe_size, eye_colour, lucky_number):
↓
Too many unneeded attributes. Abstraction means only modelling the details the program needs, such as name and score.
Applying
Meanings
Term
abstraction
Meaning
A class shows only the details needed to use it and hides the complicated working behind simple methods, so you can use a method without knowing how it works inside.
Practice
class Student:
Testing
Gaps
BankAccount:
Check Answer
Spots
3 self.temp = 20
4 def boil():

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Snowy Owl' badge — List Slicer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement best describes abstraction in OOP?
A. A class shows every detail of how it works so users can change anything
B. A class shows only what is needed to use it and hides the complicated working ✓
Abstraction keeps the useful, simple parts visible and hides the complicated details inside the class.
2. You call account.deposit(50) without knowing how the balance is updated inside. What is this an example of?
A. Abstraction: using a method without knowing how it works ✓
B. A syntax error because you must know how deposit() works
You can use a method by knowing what it does, not how it does it. That is abstraction.
3. You are designing a Student class for a school library system. Which attributes are best to model?
A. name, student_id and books_borrowed ✓
B. name, favourite_colour, shoe_size and pet_name
Abstraction means choosing only the attributes that matter for the purpose of the program and leaving out the rest.
4. Which class design shows better abstraction?
A. A Kettle class where the user must call 10 separate methods to boil water
B. A Kettle class with a simple boil() method that hides the heating steps ✓
A simple method that hides the complicated steps makes the class easier to use.
5. True or false: Abstraction means the complicated code does not exist.
A. False: the code exists but is hidden inside the class ✓
B. True: abstraction removes the complicated code completely
The working code is still there inside the methods. Abstraction just hides it from the person using the class.

Match the Pairs

account.deposit(50) → Uses a simple method to add money without needing to know how the balance is updated inside the class
class Student: def __init__(self, name, year): → Models only the details needed (name and year) and leaves out everything else about a real student
Abstraction lets you use a method without knowing how it works inside → print(car.get_speed())
A good class design only includes attributes the program actually needs → class Book: def __init__(self, title, author):
class Player: def __init__(self, name, shoe_size, eye_colour, lucky_number): → Too many unneeded attributes. Abstraction means only modelling the details the program needs, such as name and score.
total = 0 for item in cart.items: total = total + item.price → The code reaches into the class and does the working itself instead of calling a simple method like cart.get_total().

Key Term

abstraction
A class shows only the details needed to use it and hides the complicated working behind simple methods, so you can use a method without knowing how it works inside.

Fill in the Blanks

1. class BankAccount: def deposit(self, amount): self.balance += amount
Hint: Type the keyword that begins a class definition, which bundles the details a user needs.
2. account = BankAccount(100) account.deposit(50) print(account.balance)
Hint: Type the method name that adds money. You only need to know what it does, not how it works inside.
3. def deposit(self, amount): self.balance += amount
Hint: Type the operator that adds an amount onto the existing balance.
4. def area(self): return self.width * self.height
Hint: Type the keyword that hands the result back to the code calling this simple method.
5. class Thermostat: def heat(self, temp): self.temp = temp
Hint: Type the keyword that creates a simple method inside the class so users can call it without seeing the working.

Spot the Error

Question 1
A class Kettle:
B def __init__(self):
C self.temp = 20
D def boil():
E self.temp = 100
Line D — A method needs self as its first parameter so it can reach the object's data. The simple boil() method hides the working, so it must be def boil(self):.
Question 2
A class Car:
B def __init__(self, fuel):
C fuel = self.fuel
D def drive(self):
E self.fuel -= 1
Line C — The value passed in must be stored in the object with self.fuel = fuel. The broken line reads the attribute before it exists, so the model of the car has no fuel.
Question 3
A class Phone:
B def __init__(self)
C self.battery = 100
D def charge(self):
E self.battery = 100
Line B — The def line is missing its colon. It should be def __init__(self): so the constructor sets up only the details the Phone model needs.
Question 4
A class Calculator
B def square(self, n):
C return n * n
Line A — A class header must end with a colon: class Calculator:. Users can then call square() without knowing how it works inside.
Question 5
A class Toaster:
B def toast(self):
C return 'Toast is ready'
D t = Toaster
E print(t.toast())
Line D — Brackets are needed to create an object: t = Toaster(). Without them t is the class itself, so t.toast() will not work as a simple method call.

Student with a class code? Join your class →