Content deleted Content added
Undid revision 855428838 by 223.247.123.55 (talk): ? It was right before. |
|||
Line 14:
Encapsulation ''is one of the fundamentals'' of OOP ([[object-oriented programming]]). It refers to the bundling of data with the methods that operate on that data.<ref name=Rogers01/> Encapsulation is ''used to hide the values or state of a structured data object inside a class'', preventing unauthorized parties' direct access to them. Publicly accessible methods are generally provided in the class (so-called ''getters'' and ''setters'') to access the values, and other client classes call these methods to retrieve and modify the values within the object.
This mechanism is not unique to object-oriented programming. Implementations of [[abstract data types]], e.g. [[module (programming)|modules]], offer a similar form of encapsulation. This similarity
== An information-hiding mechanism ==
|