Skip to main content

Encapsulation

Programming

Bundling data with the methods that operate on it.

Encapsulation is an OOP principle of hiding an object's internal state and exposing behavior through a controlled interface. It reduces coupling and protects invariants by preventing external code from putting an object into an invalid state.

← Back to full glossary