If the variables were not marked private and an access method were not used, making this small change might involve looking over every line of the entire program for places that accessed the variables. The programming technique we have been talking about is called encapsulation .
Encapsulation means hiding the details of an object from the other parts of a program.
The object can be used only through its access methods, which are carefully written to keep the object consistent and secure. On the outside are some controls which are the only way that the user can use the box. The usual example of this is a TV set where most of the inner workings are sealed off from the user. The user interacts with the set using some well-defined controls. The controls are sometimes called the user interface .