An object encapsulates both data and functions into a self-contained package. In object
technology, functions are usually called methods. Figure 25.2 provides a conceptual
representation of an object, with the attributes on the inside protected from the outside by
the methods. Methods define the behavior of the object. They can be used to change the
object’s state by modifying its attribute values, or to query the values of selected attributes.
For example, we may have methods to add a new property for rent at a branch, to update
a member of staff’s salary, or to print out a member of staff ’s details.