众所周知,可以通过类和结构来实现接口。
类和结构类之间存在略有逻辑差异。
类型和结构是值类型。
两个类和结构都实现了一个接口。
接口标识符中包含的类和结构的基类列表。
C#中接口实现示例
class Program { static void Main(string[] args) { ABC c = new PQR(); } } interface ABC { void print(); } interface XYZ : ABC { void Read(); } class PQR : XYZ { public void Read() { } public void Print() { } }
日期:2020-04-11 23:03:42 来源:oir作者:oir