An interface determines a contract. A class or structure that implements an interface must adhere to its contract. An interface may inherit from multiple base interfaces, and a class or structure may implement multiple interfaces.
Interfaces may contain properties, methods and events. The interface itself does not provide implementations for the members that it determines. An interface merely specifies the members that must be supplied by class or structure that implement the interface.
An interface declaration is a type declaration that describes a new interface type.
interface-declaration:
attributesopt interface-modifiersopt Interface interface-name interface-baseopt
interface-body End Interface interface-nameopt ;
interface-name:
identifier
interface-body:
interface-member-declarationsopt
An interface declaration consists of an optional set of interface attributes, followed by an optional set of interface modifiers , followed by the Interface keyword and an identifier that determines the interface. Next, is an optional specification of base interfaces, followed by interface body that end with the keyword sequence End Interface. Interface body contains declaration of its members.
Additional information is contained in the following subsections:
See also: