Chapter 7 C # Interface

This article is transferred from: http://m.biancheng.net/csharp/70/

In daily life, electronic products such as mobile phones, laptop computers, and tablet computers provide different types of interfaces for charging or connecting different devices.

Different types of interfaces have different standards, such as voltage and size.

In the C # language, the interface also defines a standard. If you need to use the interface, you must meet the content defined in the interface.

In the C # language, the inheritance relationship between classes only supports single inheritance, and the interface is designed to achieve multiple inheritance relationships.

A class can implement multiple interfaces at the same time, it can also inherit other classes while implementing the interface, and interfaces can also inherit.

In this chapter:
1.  C # interface: define the interface
2.  Two ways for C # to implement an interface: display implementation and implicit implementation
3.  Implementation of polymorphism in C # interface

Guess you like

Origin www.cnblogs.com/hanguoshun/p/12729402.html