How Arguments Are Passed : Method Parameter : Class C# Examples


C# Examples » Class » Method Parameter »

 

How Arguments Are Passed





Call-by-value:

Copy the value of an argument into the formal parameter.
Change made to the parameter have no effect on the argument used in the call .

Call-by-reference.

A reference to an argument is passed to the parameter.
Change made to the parameter will affect the argument used to call the subroutine.

When you pass a value type, such as int or double, to a method, it is passed by value.
An object is passed by reference



HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Method Parameter