9.3k views
0 votes
What is the difference between an argument and a parameter?

1 Answer

1 vote

Step-by-step explanation

Parameter is basically a variable which is defined by a method/function.

When a method/function is called then this Parameter receives the value.

In any method/function, Parameter works as recipient.

If we pass a value In a method/function when it invokes then that value is

called Argument.In any method/function, Argument works as agent.

Example:

// here p1 and p2 are parameters in the method

fun test(p1,p2)

{

return p1+p2;

}

// here 2,6 are Argument in the method

test(2,6);

User Atonyc
by
8.4k points

No related questions found