Encapsulation in OOP is the principle of restricting direct access to an object’s internal state and requiring all interaction to occur through its public methods. It protects the integrity of the data by preventing external code from making unauthorized or harmful changes. Encapsulation is often achieved by using Access Modifiers like private, protected, and public, allowing fine-grained control over what can be accessed from outside the class.
Encapsulation is a fundamental building block alongside Inheritance, Polymorphism, and Abstraction.