Example #1
0
        public void Test()
        {
            BaseClass    b      = new BaseClass();
            DerivedClass d      = new DerivedClass();
            BaseClass    bWithd = new DerivedClass();

            b.Method1();
            b.Method2();
            d.Method1();
            d.Method2();
            bWithd.Method1();
            bWithd.Method2();
        }
Example #2
0
        public static void OverridingMethods()
        {
            BaseClass    bc   = new BaseClass();
            DerivedClass dc   = new DerivedClass();
            BaseClass    bcdc = new DerivedClass();

            bc.Method1();
            bc.Method2();

            dc.Method1();
            dc.Method2();

            bcdc.Method1();
            bcdc.Method2();
        }