.NET seventh day

1, out parameters
can help us return multiple values in one method, the type is not limited.
Use out parameters when required, out parameters must be assigned values in the method. out parameters from time initial value.

. 1, ref parameters
ref parameters will focus on a method, a variable taken as a parameter changes,
the change is completed, and then change the value of the tape out. (Ie, the value will change the outside)
when using the ref parameter Note: ref parameter must give a value outside the method.

2, overloaded methods
overloaded method refers to a method of the same name, but different parameters.
Different parameters:
1), if the same number of parameters, the parameters can not be the same type.
2), if the same type of the parameter, then the number of parameters can not be the same.

Overloaded methods with the return value does not matter.


3 summarizes methods
1, effect: makes the code repeated using
2 parameters: completion condition This method must be in the
3, the return value: After completion of the method, the result returned by the method
4, out parameters: allows the method returns multiple values
5, ref parameters: a variable focus on the changes to the process, after completion of the change, the value of the repeat changes taken out.
6, params variable parameters: the argument list with variable parameter array type is an element of the same parameters as variable parameters array.
Variable parameters parameter must be the last element in the list
recursion 7, method: calls itself in the process.

Guess you like

Origin www.cnblogs.com/zhengxia/p/12057608.html