Encapsulation concept of the object model Encapsulation Encapsulation is the object model concept of including processing or behavior with the object instances defined by the class.
Encapsulation allows code and data to be packaged together.
The definition of methods for a class is an integral part of encapsulation. A method is programming code that performs the behavior an object instance can exhibit. Calculating the age of a person would be an example of such behavior. The figure shows a way of looking at encapsulating the age method with an instance object. More on encapsulation .