Why? encapsulation
- Wang Sibo
- Oct 7, 2019
- 1 min read
Updated: Mar 20, 2020
Encapsulation includes the idea that the data of an object should not be directly exposed. Instead, callers that want to achieve a given result need to invoke a method.
In OOP, that means that an object stores its state privately, and only the object’s methods have access to change it.
댓글