如题!
------解决方案--------------------------------------------------------
- C# code
public interface IClass1{ void Info();}public class Class2 : IClass1{ public void Info(){//... System.Console.WriteLine("it's Class2!"); }}public class Class3 : IClass1{ public void Info(){//... System.Console.WriteLine("it's a Class3!"); }}public static void Main(){ IClass1 cls = new Class2(); cls.Info(); cls = new Class3(); cls.Info();}