A parameter is a variable name for a piece of data passed into or out of a method. The parameter is the name by which that piece of data is referred to within the body of the method. Parameters are listed as part of a method’s declaration, within the parentheses that follow the method’s name.
You specify a parameter by indicating the type of the parameter and its name.
1
2
| // Bark has 4 parameterspublic void Bark(int numTimes, string sound, ref int globalBarkCount, out bool didBark) |
An argument is a constant or variable name passed to a method. Each argument maps to one of the method’s parameters.
When you specify an argument, you specify the value that will be passed to the method or a variable containing the value.
1
2
| // 4 arguments passed to Bark method<span class="skimlinks-unlinked">myDog.Bark(2</span>, "Woof", ref globCount, out didBark); |

