Chapter 98·Beginner
Encapsulation: Protecting an Object's Data Behind a Small Interface
01 / 04
The core idea
An object hides its internal state and exposes only a small set of methods. Callers use the methods; they can't reach in and corrupt the data.