Encapsulation is the rules require internal state of an object to be protected and prevent access from external code (ie code outside can not directly see and change the state of that object). Any public access to this internal state forced through a public API to ensure the status of the object is always valid because the public API is responsible for implementing the validity check and update sequence Update the status of that object.
in OOP has a rule that is important to remember to always declare the internal state of the object is private and only accessible via public / protected method / property
đang được dịch, vui lòng đợi..