static void Main(string[] args) { var derived1 = new Derived1(); var derived2 = new Derived2(); derived1.Print(); derived2.Print(); }
public static void Main() { Derived2 d2 = new Derived2(); Base @base = d2; Derived1 d1 = d2; @base.Print(); @base.PrintA(); @base.PrintB(); d1.Print(); d1.PrintA(); d1.PrintB(); }