Please enable JavaScript to use CodeHS

CodeHS Glossary


Encapsulation General

Encapsulation keeps an object's fields private and exposes them only through methods such as accessors and mutators, so other code can't put the object into an invalid state.