Class Encapsulation
From CSSEMediaWiki
Revision as of 23:18, 29 August 2009 by Matthew Harward (Talk | contribs)
Class Encapsulation is the most commonly used form of Encapsulation in modern programming languages. Objects are encapsulated by their underlying objects. This means that:
- Objects can see/modify the contents of any other objects that are instances of the same class.
- Objects can see/modify the contents of their superclass (this is language specific)
- Objects cannot see/modify the contents of any other objects.
This type of Encapsulation exists in contrast to Object Encapsulation.
Usage
This, or a modified form of, is the encapsulation technique of languages such as C++, C#, Java and Python.