Encapsulation
Encapsulation is the process of combining variables that store data and methods that work on those variables into a single unit called class .
In Encapsulation, the variables are not accessed directly; it is accessed through the methods present in the class. Encapsulation ensures that the object’s internal representation (its state and behavior) are hidden from the rest of the application. Thus, encapsulation makes the concept of data hiding possible . Usually, it is implemented as non-public class methods (private, protected, partial, internal). Encapsulation allows developers to hide some code and create interfaces that other developers can use. Encapsulation allows class authors to decide how objects would behave independently, unlike functional programming, where only public functions exist. [2, 396.] This approach allows more experienced engineers to compose well-reviewed industry-standard implementations while protecting less sophisticated users who cannot break it by just accidentally using it in a way it was not intended to be.
Gowrishankar S., Veena A., Introduction to Python Programming, 2018
N. B. Dale; C. Weems. (2007). Programming and problem solving with Java (2nd ed.). Burlington, the USA: Jones & Bartlett Learning.