10. Parameter Passing

Objects communicate by calling methods on each other. A method call is used to invoke a method on an object. Parameters in the method call provide one way of exchanging information between the caller object and the callee object.

The syntax of a method call can be any one of the following:

<object reference>.<method name> (<actual parameter list>)

<class name>.<static method name> (<actual parameter list>)

<method name> (<actual parameter list>)

Let’s look at each element in method call syntax.