Java Programming
VBNET
C Sharp

What is the difference between actual and formal parameters?

333435

Answer

User Avatar
Wiki User
12/09/2009

Formal parameters are the parameters as they are known in the function definition. Actual parameters (also known as arguments) are what are passed by the caller. For example, in the following code, a and b are the formal parameters, and x and y are the actual parameters:

int max(int a, int b) {
if (a > b) return a;
else return b;
}

int m = max(x, y);