Understanding of Delegate Delegation

Source: Internet
Author: User

Q: ping Zi asks a question


When a delegate is defined, the argument is of type int why can you pass a function name in to explain the usage of the delegate?


< Span style= "font-family: Song Body, ' MS Sans Serif ', Sans-serif; Font-size:16px "> answer:
This int is the parameter of your specific method,  is not a delegate parameter.  
You can think of a delegate as a type of method .   you're going to have to wrap this up your way.,  is not to wrap int


Q: Then why should I use a delegate

Answer: Because you are the method body


Can support n methods that pass int instead of a

So you can bring it up.


Description: In the Internet to see the code, there is not understand the place, want to ask friends, friends to give the answer, share with you, what questions can leave a message.

Understanding of Delegate Delegation

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.