static void Main(string[] args) { Console.WriteLine("---------------------调用抽象类/接口----------------------"); IFather a = new Son1(); //Father a = new Son(); a.show(); Console.WriteLine("-------------------调用实现类-------------------"); Son1 SON = new Son1(); SON.show(); Console.WriteLine("----------------------------------------------------"); IFather B = new BaseClass(); AbstractIFather C = new BaseClass(); B.show(); C.show(); }
static void Main(string[] args) { Console.WriteLine("---------------------调用抽象类/接口----------------------"); IFather a = new Son1(); //Father a = new Son(); a.show(); Console.WriteLine("-------------------调用实现类-------------------"); Son1 SON = new Son1(); SON.show(); Console.WriteLine("----------------------------------------------------"); IFather B = new BaseClass(); AbstractIFather C = new BaseClass(); B.show(); C.show(); }