Interface Description
Interface ( Interface ) Is used to defineProgram. The class or structure that implements the interface must be strictly consistent with the interface definition. With this agreement, you can leave it alone.Programming Language(Theoretically ). Interfaces can be retrieved from multipleBasic InterfaceThe class or structure can implement multiple interfaces. The interface can contain methods, attributes, events, and indexers. It cannot be a constant, field, operator, constructor, or destructor, and cannot contain any static member. The interface itself does not provide the Implementation of the members it defines. The interface only specifies the class that implements the interface or the members that the interface must provide. Technically, an interface is a set of data structures that contain functional methods. Through this set of data structures, the customerCodeYou can call the functions of component objects.
the interface is similar to a template. This template defines the methods required for object implementation, the purpose is to enable these methods to be referenced as interface instances . The interface cannot be instantiated. Class can implement multiple interfaces and are indexed through these interfaces. Interface variables can only be indexed to instances of classes that implement this interface.
1 , C # are defined independently of the class .
2 , interfaces, and classes you can inherit multiple interfaces .
3 , a class can inherit a base class., the interface cannot inherit classes at all . C # the simplified interface model helps accelerate application development.
4 an interface defines only abstract members.. C # what an interface actually does is only the method flag, but no code is executed. This implies that one interface cannot be instantiated, and only one object derived from this interface can be instantiated .