Data Encapsulation is an Object-Oriented Programming concept of hiding the data attributes and their behaviors in a single unit.
It helps developers to follow modularity while developing software by ensuring that each object is independent of other objects by having its own methods, attributes, and functionalities.
It is used for the security of the private properties of an object and hence serves the purpose of data hiding.