What is the difference between Parameter and Argument in Java? Devesh Kumar Singh163105-Nov-2015javajava Updated on 24-Sep-2020
Devesh Kumar Singh
05-Nov-2015The term parameter refers to any declaration within the parentheses following the method/function name in a method/function declaration or definition.
Whereas, the term argument refers to any expression within the parentheses of a method/function call. i.e.
· Parameter used in function/method definition.
public static int add(int x, int y) { //x, y are parameters here
· Arguments used in function/method call.
int sum = add(x, y); //x, y are arguments here