C#中的多重继承
public interface IFirst { void FirstMethod(); }public interface ISecond { void SecondMethod(); }public class First:IFirst { public void FirstMethod() { Console.WriteLine("First"); } }public class Second:ISecond { public void SecondMethod() { Console.WriteLine("Second"); } }public class FirstAndSecond: IFirst, ISecond{ First first = new First(); Second second = new Second(); public void FirstMethod() { first.FirstMethod(); } public void SecondMethod() { second.SecondMethod(); }}
public class FirstAndSecond: IFirst from First, ISecond from Second{ }
慕沐林林
宝慕林4294392
HUH函数
相关分类