Communication between two functions: ==================================== 1. When you define a function, it will eventually be called by another function. Suppose we have two functions: foo and bar, and foo calls bar as follows. So, foo is the 'caller' and bar the 'callee' in this example: public static int bar (int a, int b) { int c = 3; int d = 4; a = c; b = d; return a + b; } public static void foo () { int x = 1; int y = 2; int z = bar(x, y); } Let us make some observations here: 1. The variables x, y, and z are meaningful ONLY WITHIN the body of the function foo. That is, you cannot use them anywhere outside that function in a program that contains these two functions. 2. Similarly, the variables a, b, c, and d are meaningful ONLY WITHIN the body of the function bar. That is, you cannot use them anywhere outside that function. You must obey the rules that specify which variable is visible within what part of the program. Each function has its own area where the variables in that function are meaningful. The area in which a variable has a meaning is called the 'SCOPE' of the variable. For example, the scope of x is inside foo and the scope of b is inside bar. 3. The only ways to communicate any value between a caller (e.g., foo here) and a callee (e.g., bar here) are as follows: 3.1. The caller can pass a value to the callee only through parameters (e.g., from x and y in foo to a and b of bar in this example). So, the VALUE of x in foo is passed to a in bar, and the VALUE of y in foo is passed to b in bar. If you change the value of a or b within bar, that has no effect on the values of x and y in foo! That is, the effect on changing the values is localized. So, passing values from a caller to a callee is a ONE-WAY communication, i.e., from the caller to the callee. 3.2. If a callee (bar in this example) wants to communicate any value back to the caller (foo here), the only way is via the 'return' statement. So, in this example, the VALUE of a + b is returned to the caller (foo), and the returned value is assigned to z in foo, thus communicating a value (a + b) in the context of bar to z in the context of foo. The end result is that we changed the value of z in foo by making a call to bar, but not affecting the value x or y. Yes, when a callee returns something, it is always returning it to the caller of that function. In summary, a caller can pass values to a callee via parameters, and the callee can pass a value to its caller only by the return statement. There is no other way of communicating a value between two functions (caller and callee) in Java. There are actually other ways to do it, but I am going to INSIST that this is the ONLY way FOR NOW. A caller can pass multiple values to a callee via formal parameters, but a callee can return ONLY ONE value to the caller via the return statement, i.e., there is no way of returning multiple values from a callee to its caller in Java.