Under this definition, encapsulation meansmean's that the internal representation of an [[object (computer science)|object]] is generally hidden from view outside of the object's definition. Typically, only the object's own methods can directly inspect or manipulate its fields. This rule is strictly enforced in some languages like [[Smalltalk]], but most other (e.g. C++ or Java) offer the programmer a degree of control over what is hidden, typically via keywords like <code>public</code> and <code>private</code>.<ref name=Pierce/> A few languages that support object-oriented features, like [[Python]], do not provide a mechanism to hide fields.
Hiding the internals of the object protects its integrity by preventing users from setting the internal data of the component into an invalid or inconsistent state. A benefit of encapsulation is that it reduces system complexity and thus increases robustness, by limiting the interdependencies between software components.