C # Illustration Tutorial Three: Methods of reading Notes

Source: Internet
Author: User

This article has been included in the "C # Illustrated Tutorial" Reading Notes directory sticker, click to access the directory for more content.

One, the way that thing

(1) The structure of the method: Method Header-Specifies the characteristics of the method, the method body-the sequence of statements of the executable code;

(2) method invocation: parameter, value parameter, reference parameter, output parameter, parameter array;

① Parameters:

Formal parameter-local variable, declared in the parameter list; The value of the formal parameter is initialized before the code starts;

The value of the argument-argument is used for the initial taxiing parameter;

② Value parameter:

Allocates memory on the stack for the parameter and copies the value of the argument to the formal parameter;

③ Reference Parameters:

No memory is allocated on the stack for formal parameters, parameter names for arguments to argument variables point to the same location, must use the REF keyword, and need to be assigned beforehand;

④ Output Parameters:

Basically the same as the reference parameter, but must be assigned within the method, you must use the Out keyword, do not need to be assigned in advance;

⑤ parameter array:

There can be only one parameter array in a parameter list; If so, it must be the last one in the formal parameter list; all parameters in the array must be of the same type;

(3) Overloading of methods: one or more methods in a class have the same name; Method Signature

Second, stack frame and recursion

(1) stack frame : When invoking a method, the memory is allocated from the top of the stack, and some data items associated with the method are saved. This piece of memory is called the stack frame of the method.

Stack frames include: Return address, method value parameter or parameter array, other management data items;

(2) recursion : The method itself calls itself, the new stack frame is pressed into the top of the stack for each method call;

Third, this chapter mind map

Attachment

Mind Mapping (Jgp,pdf and mmap files) Download: Http://pan.baidu.com/s/1kTum9gF

Zhou Xurong

Source: http://www.cnblogs.com/edisonchou/

The copyright of this article is owned by the author and the blog Park, welcome reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to give the original link.

C # Illustration Tutorial Three: Methods of reading Notes

Related Article

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.