IntroductionPassing Parameters to a method is explained here.
C#.Net supprots to pass the parameters in three ways
When formal argument is modified, if modifications are reflected on actual arguments,then the concept is called as CallByRef.
When formal arguments are modified, if modifications are not reflected in actual arguments, then the concept is called as CallByValue
By default all the variables will be passed by value.
To pass a variable by reference, ‘Ref’ keyword is used.
Ref keyword must be used along with formal and actual arguments.
The variables passing by ref must be initialized.
CallByOut: Out is a keyword. Out and Ref are almost same. Ref variables must be initialized,but Out variables can be passed without initialization also. Even if Out variable is initialized, the value will not be passed.
CBV: Value will be passed.
CBR: Value and Address will be passed
CBO: Only address will be passed.