1, in the main () function, we call the test () function, we call the main () function called the caller,
The tube test () function is called the callee.
If the callee wants to get the caller's value:
1), passing parameters.
2), use static fields to simulate global variables.
If the caller wants to get the value of the callee:
1), return value
2.
Whether it is an argument or a formal parameter, it opens up space in memory.
3, the method must be a single function.
Getmax (int n1,int n2)
The most taboo in the method is the word that prompts the user to enter.
4, out, ref, params
1), out parameters.
If you are returning multiple values of the same type in a method, you might consider returning an array.
However, if you return a number of different types of values, the return array will not be, then this time,
We can consider using out parameters.
The out parameter focuses on the ability to return several different types of values in a method.
2), ref parameter
The ability to take a variable into a method to change, after the change is completed, then the change in the value of the method.
The ref parameter requires that a value be assigned outside the method, and the method may not be assigned a value.
3), params variable parameter
The elements of the argument list that are consistent with the variable parameter array type are treated as elements of the array.
The params variable parameter must be the last element in the formal parameter list.
5. Overloading of methods
Concept: Overloading of methods means that the name of the method is the same, but the parameters are different.
Different parameters, divided into two kinds of situations
1), if the number of arguments is the same, then the type of the parameter cannot be the same.
2), if the parameters of the same type, then the number of parameters can not be the same.
The overloads of the method are not related to the return value.
6. Recursion of the method
Method itself to invoke itself.
Find all the files in a folder.
C # Foundation