Define interface 3

xiaoxiao2021-03-06  51

An interface of the base can be inherited from zero or multiple interfaces, those explicit base references known as this interface. When an interface is more than zero-multi-expirant base, then in the form of the interface is in the form of the interface identifier, the interface identifier is followed by a colon ":" and a comma "," separated base interface identifier list.

Interface base:

: Interface Type List Description:

1. The explicit base reference of an interface must be at least accessible to the interface itself. For example, specifying a private or internal interface in the base interface of a common interface is wrong.

2, one interface is inherited directly or indirectly is wrong.

3. The base reference of the interface is an explicit base interface and is the base reference thereof. In other words, the set of basegings is completely composed of explicit base interfaces and their explicit base interfaces. In the example below

interface IControl {void Paint ();} interface ITextBox: IControl {void SetText (string text);} interface IListBox: IControl {void SetItems (string [] items);} interface IComboBox: ITextBox, IListBox {}

ICOMBOBOX basegings are iControl, ITextBox, and IListbox. 4. One interface inherits all members of its base connection. In other words, the above interface ICOMBOBOX inherits the member setText and SetItems as Paint. 5. A class or structure that implements an interface also implies the base interface of all interfaces. Interface main body of an interface body defines a member of the interface.

Interface-body: {interface-member-declarationsopt}

The definition interface is primarily defined as a member, please see the next section - Define the interface member.

转载请注明原文地址:https://www.9cbs.com/read-83896.html

New Post(0)