What are Out and Ref parameters?

beingchinmay

New member
• The out parameter - return the values in the same variable passed as a parameter of the m thod. Any changes made to the parameter will be reflected in the variable.

• The ref keyword on a method parameter causes a method to refer to the same variable that was passed as an input parameter for the same method. If you do any changes to the variable, they will be reflected in the variable.

• The implementation of ref and out parameter in IL Code(in CLR) is same, there is no difference whether you use ref or out parameters.
 
Back
Top