C # Knowledge Point collation

Source: Internet
Author: User

1. In the main () function, we call the test () function, and we call the main () function the caller, and the tube test () function is called the called Person.

If the callee wants to get the caller's value: 1), pass the parameter. 2), use static fields to simulate global variables.

If the caller wants to get the value of the callee: 1), the return value

2, whether it is a real parameter or a formal parameter, is in the memory of open space.

3, the method must be a single function. Getmax (int n1,int n2) method is the most taboo is the word that prompts the user input.

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 work, then we can consider using the out parameter.

The out parameter focuses on the ability to return several different types of values in a method.

2), ref parameter can take a variable into a method to change, after the change is completed, then the change of 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. Overloaded concept of methods: overloading of methods means that the name of the method is the same, but the parameters are different.

Parameters differ in two cases 1), and 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, the method of the recursive method itself calls itself. Find all the files in a folder.

C # Knowledge Point collation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.