A function, also known as a method, is the smallest modular unit; it carries out a single subtask in a class. Recall that classes are reusable units, which means that they can be used in another application. Functions are not reusable units because every function belongs to a class. From this point of view, a function is an internal decomposition unit.
A function can receive input data from another function when invoked; the input data passed from another function is called a parameter. The function can also return output data when it completes execution.
In its first part, this chapter describes class and function decomposition. The second part of the chapter discusses the basic mechanisms for data transfer between two functions; several examples are included.