C # Interface

Source: Internet
Author: User

I have read several interface content on the Internet, including popular and professional content. Based on these content and my own understanding, I will write down the following experiences. If you have any questions or errors, please do not give me any further advice.

The interface is declared using the interface. The naming principle starts with I. For example, to define a socket isocket, define two ports and three ports and two jacks in the isocket. This should also be noted that both members are public, if other Members must be public, this interface is basically complete. In fact, the interface is a standard for implementing classes.

Then write the specific implementation class and write a method for the two-port jack standard. If the voltage is set to 50 V, we can use this interface to instantiate this class, to achieve the goal of inserting a 50 V two-port socket. If you want to insert a V three-port jack, you can add such a method in this class, or create a new class to add such a method.

It can be said that interfaces are a standard for communication between different classes and are provided to the same rules for different classes. The printer examples on the Internet are also very understandable.

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.