. NET basic step by step: [out, ref, params],. netoutrefparams
Out,Ref,Params
Out:
If you return multiple values of the same type in a method, you can consider returning an array.
However, if multiple different types of values are returned, the returned array will not work. At this time,
We can consider using the out parameter.
OutParameters focus on returning multiple different types of values in a method. ParametersInitialization must be completed in the Method
Case:
Ref:
A variable can be brought into a method for change. After the change is completed, the changed value is taken out of the method.
RefThe parameter must be assigned a value outside the method, but not in the method.
Case:
Params;
The elements in the real parameter list that are consistent with the variable parameter array are processed as elements of the array.
ParamsA variable parameter must be the last element in the parameter list.
Case:
Well, this article is here, and the case provided in this article is only, there is no running result, please handle it yourself. I hope it will help beginners. I also hope that the great gods will take us with us, pack us with force, and fly us with us...
Finally, make a small advertisement: QQ group:. NET Step by stepGroup Number:590170361(Add group remarks: what you see in the blog Park)