Technically, an interface is a set of data structures that contain a function-type method. With this set of data structures, client code can invoke the functionality of the Component object.
15.2.1 statement
An interface declaration is actually a type declaration that defines a new interface, and the format of the declaration is as follows:
Attributes Interface-modifiers interface identifier Interfacebase interface-body;
Interfaces can use the following modifiers:
New
Public
Protected
Internal
Private
The same modifier is not allowed to occur more than once in an interface definition, and the new modifier can only appear in nested interfaces, representing members of the same name that have inherited.
The Public,protected,internal,and private modifier defines the access rights to an interface.
In the declaration body of an interface, you can define the members of an interface. The members of an interface can be methods, properties, index indicators, and events.
The following example defines an interface named IControl that contains a member method paint:
Interface IControl
{
void Paint ();
}
Inheritance of the 15.2.2 interface