Let's quickly review the basic OOP principles:
- Encapsulation
- Abstraction
- Inheritance
- Interfaces
- Polymorphism
- Composition
Let's quickly review the basic OOP principles:
The idea of encapsulation is to create objects that hold a private state and that keep control over it. Keeping control means that other objects may not modify the private state directly. Instead, they have to call specific functions called methods to be able to make those changes. Encapsulation is a core idea of OOP; it helps to ensure that mutations (that is, modifications) cannot be made without control/oversight of the owner of the relevant data. Also, encapsulation helps in hiding complexity.
To support encapsulation, OOP languages...