A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters.
- Given the following example function that adds two integers, x and y would be referred to as its parameters:
int add(int x, int y) {
return x + y;
}
- At a call-site using add, such as the example shown below, 123 and 456 would be referred to as the arguments of the call.
int result = add(123, 456);
- Also, some language specifications (or formal documentation) choose to use parameter or argument exclusively and use adjectives like formal and actual instead to disambiguate between the two cases. For example, C/C++ documentation often refers to function parameters as formal arguments and function call arguments as actual arguments.