A class is a blueprint or template that defines structure (fields) and behavior (methods). An object (or instance) is a concrete thing built from that blueprint, with its own values in memory.
Blueprint vs. instance
text
class Car ← ONE definition (the blueprint)
│ fields: color, speed
│ methods: accelerate()
▼
new Car("red") ← many OBJECTS (instances), each with its own state
new Car("blue")
In code
python
:
():
.color = color
.speed =
():
.speed +=
a = Car()
b = Car()
a.accelerate()
(a.speed, b.speed)
(a.color b.color)
