Encapsulation

Back to Core Pillars

Bundling data and the methods that operate on it within a single unit (class/object), and restricting direct access to internal state. Encapsulation enforces data hiding through access modifiers (public, private, protected), reducing coupling and protecting invariants.

programming-paradigms oop encapsulation