What is the difference between arguments and parameter? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the difference between arguments and parameter?

26th Jun 2020, 12:25 PM
GetNet Bekelle
GetNet Bekelle - avatar
3 Answers
+ 3
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. Parameter is variable in the declaration of function. Argumentis the actual value of this variable that gets passed to function. Ex: function test(param1, param2) { return param1+param2; } test(5,6); Here param1 and param2 are parameters and 5 and 6 are arguments
26th Jun 2020, 12:44 PM
123
+ 3
Though I don't know C++ or C but in python parameter is used for creating a functions and use it to perform operations and arguments are used outside the function to use that function
26th Jun 2020, 12:50 PM
Arctic Fox
Arctic Fox - avatar
+ 1
imho qoute 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. https://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter A method has parameters void AMethod(int x) -> int x is a parameter int x = 3; AMethod(x) -> x which has the value 3 is a argument similar with class which is the description and object which is a instance.
26th Jun 2020, 12:48 PM
sneeze
sneeze - avatar