This chapter will discuss the parameters in C#. The focus will be to show different ways of passing parameters to a method, such as pass by value, pass by reference, and pass default value of the parameter. You will find explanations of these in detail and see how CLR handles these behind the scene.


The parameter is the mechanism used to accept input to a method from the caller of that method. In a method signature, you can define the parameter or parameters to accept the input. These parameters could be any type, such as value types, for example, Int32, string, or reference type for an instance object, a person ...

Get Expert C# 5.0: with the .NET 4.5 Framework now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.