接口的使用
static void Main(string[] args) { var k = new Test() { ID = 1, Age = 15 }; T1 a = k; T2 b = k; a.show(); //Console.WriteLine(b.Age); b.show(); } } class Test:T1,T2 { public int ID { get; set; } public int Age { get; set; } public void show() { Console.WriteLine(ID); } } interface T1 { public int ID { get; set; } public void show(); } interface T2 { public int Age { get; set; } public void show(); }