C#-接口

接口 (interface) 定义了一个可由类和结构实现的协定。接口可以包含方法、属性、事件和索引器。接口不提供它所定义的成员的实现 — 它仅指定实现该接口的类或结构必须提供的成员。
接口可支持多重继承。在下面的示例中,接口 IComboBox 同时从 ITextBox 和 IListBox 继承。

interface IControl
{
   
    void Paint();
}

interface ITextBox : IControl
{
   
    void SetText(string text);
}

interface IListBox : IControl
{
   
    void SetItems(string

你可能感兴趣的:(C#,c#,开发语言)