You now know the different steps which are executed
when a method is called in a program, and you now can see
a little diagram which summarizes these various steps.
Here, we have a method "f" called by a method "g".
The match between the parameters of the method and the calling arguments
is done at the moment of the method call.
So here, when we call the method, the argument is copied into the parameter
of the method which uses this to fulfill its job.
In the most general case, the method calculated a return value
and this return value is transmitted to the calling method which will be able
to use it to carry out its instructions.
You will no doubt have noticed all along this episode that
there is a certain jargon, a terminology associated to a method call.
Let's now summarize this jargon.
You will have understood that when I speak of "calling a method", I mean
that I use the method; here, I am using the method f to calculate
a result that I then assign to a variable x.
When I speak of "passing a value" as argument to a method, I mean
that this value is simply copied into a parameter of the method.
And finally, when I say that a method "returns" the value of y, for example,
I mean that the expression of the function call will simply be
replaced by the returned value.
So if we take a real example now, suppose that we have a
method "f" whose last instruction is this one
Suppose that this method is called like so, and that at the moment
of the call, the value of y is 5. To say that the method
returns the value of y -- that is, 5 -- is the same as to say that we simply
replace this call by the return value, i.e. 5.
And so, I can equally say "cos(0) returns cosine of zero",
or "cos(0) returns 1", for example.