The Core foundation of C # 1.0

Source: Internet
Author: User

2.1 Delegates

Instead of specifying a behavior to execute directly, the behavior is "contained" in an object in some way. This object can be used just like any other object. In this object, you can perform the encapsulated operation. You can treat a delegate type as an interface that defines only one method, and a delegate instance as an object that implements that interface.

Like wills, Wills consist of a series of directives, such as: "Pay bills, donate money, leave the rest to the cats." After the death, the lawyer will execute these instructions. A delegate in C #, like a real-world will, performs some column operations at the right time. Delegates can generally be used if the code wants to perform operations but does not know the details of the operation.

The Core foundation of C # 1.0

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.