Skip to content
Definition
Abstraction creates a simplified model that represents reality without capturing all of its complexities. In computer science, real-world entities and processes are often represented using abstract models such as tables, databases, or objects in object-oriented programming (OOP).

Representing Reality in Code

Worked Example
Objects in OOP vs Real World
Real-world car detailIncluded in simple Car abstraction?
Thousands of mechanical partsNo
Wear and tear historyNo
Fuel and engine thermodynamicsNo
Current speed/stateYes
Actions like start/brakeYes
pseudocode
class Car:
    private colour
    private model
    private speed
    private isRunning

    public procedure start()
    public procedure accelerate(amount)
    public procedure brake()
    public function getSpeed()
end class
The abstraction keeps the essentials for the task and omits unnecessary physical complexity.
Worked Example
Variables and Data Structures
Real-world versionAbstract program model
Names on paper liststudentNames array/list
Re-order manuallystudentNames.sort()
Add a new name manuallystudentNames.add("Eve")
Count names manuallylength(studentNames)
pseudocode
studentNames = ["Alice", "Bob", "Charlie", "Diana"]
studentNames.sort()
studentNames.add("Eve")
count = length(studentNames)
The array abstraction hides memory allocation and low-level storage mechanics.