The parameter is the local variable in the method and the argument is the caller-supplied value/reference.
In the given example, the parameter for doSomething is 'a' and the argument is 22.
public static void doSomething(int a)
{
System.out.println("The argument was " + a);
}
public static void main(String[] s)
{
doSomething(22);
}
In the given example, the parameter for doSomething is 'a' and the argument is 22.
public static void doSomething(int a)
{
System.out.println("The argument was " + a);
}
public static void main(String[] s)
{
doSomething(22);
}
Comments