An object can be defined as a section of source code that
contains data and provides services. The attributes of the object are formed by
the data. The services are known as methods (also known as operations or
functions). Typically, it is seen that the methods operate on private data (the
attributes, or state of the object), which is only visible to the methods of
the object. Thus, the attributes of an object cannot be changed directly by the
user, but by the methods of the object only. This guarantees the internal
consistency of the object.