C# Out parameters Vs REF parameters | Difference between ref and out parameters in C#
ref keyword
1. Ref is two way from caller to callee and back
2. It is necessary the parameters should initialize before it pass to ref.
3. The passing of value through ref parameter is useful when the called method also need to change the value of passed parameter
4.It is not necessary to initialize the value of a parameter before returning to the calling method.
out keyword
1.Out is one way it sends data back from callee to caller
2.It is not necessary to initialize parameters before it pass to out.
3.The declaring of parameter through out parameter is useful when a method return multiple values.
4.It is necessary to initialize the value of a parameter before returning to the calling method.
Download
0 formats
No download links available.
C# Out parameters Vs REF parameters | Difference between ref and out parameters in C# | NatokHD