Ejemplo n.º 1
0
        static void Main()
        {
            Base derivedNewAbstract       = new DerivedNew();
            Base derivedOverridenAbstract = new DerivedOverriden();

            derivedNewAbstract.IdentifyYourself();       // prints Based i here
            derivedOverridenAbstract.IdentifyYourself(); // prints DerivedOverriden is here

            DerivedNew       derivedNew       = new DerivedNew();
            DerivedOverriden derivedOverriden = new DerivedOverriden();

            derivedNew.IdentifyYourself();       // prints DerivedNew is here
            derivedOverriden.IdentifyYourself(); // prints DerivedOverriden is here
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Base derivedNewAbstract = new DerivedNew();
            Base derivedOverridenAbstract = new DerivedOverriden();

            derivedNewAbstract.IdentifyYourself();  // prints Based i here
            derivedOverridenAbstract.IdentifyYourself();    // prints DerivedOverriden is here

            DerivedNew derivedNew = new DerivedNew();
            DerivedOverriden derivedOverriden = new DerivedOverriden();

            derivedNew.IdentifyYourself();  // prints DerivedNew is here
            derivedOverriden.IdentifyYourself();    // prints DerivedOverriden is here
        }