A method consists of a name and a body that performs the behavior associated with the
method name. In an object-oriented language, the body consists of a block of code that
carries out the required functionality. For example, Figure 25.3 represents the method to
update a member of staff’s salary. The name of the method is update Salary, with an input
parameter increment, which is added to the instance variable salary to produce a new
salary.