Difference between argument and parameter

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. When you write code you define parameters in method, when you run code you pass argument to the parameterized methods.

public void MyMethod(string myParam) { }

...

string myArg1 = "this is my argument";
myClass.MyMethod(myArg1);

A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method’sparameters. Parameter is variable in the declaration of function.Argument is the actual value of this variable that gets passed to function.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s