Computer Science / Unit 7 CS 0373 short lesson, about 20 seconds
Encapsulation
Captions available
The idea
Encapsulation makes a class's attributes and behaviors self-contained, traveling with the object through its lifetime, with internal implementation hidden from outside — enforced by scope rules and access modifiers.
In practice
A fare card exposes tap-to-pay and hides everything about how the balance lives inside.
Where people slip
The hiding is a promise to callers, not shyness.
Your place on the trail
Every lesson rests on earlier ones and opens later ones. Tap any to jump.
Something wrong in this lesson? Flag it · Sources for Computer Science