Exemple #1
0
        public InheritanceAndPolymorphismV2()
        {
            ClassB y = new ClassB();
            ClassA x = new ClassA();
            ClassB z = new ClassA();

            y.AAA(); y.BBB(); y.CCC();

            x.AAA(); x.BBB(); x.CCC();

            z.AAA(); z.BBB(); z.CCC();
            Console.ReadKey();
        }
Exemple #2
0
        public InheritanceAndPolymorphismV2_1()
        {
            ClassB y = new ClassA();
            ClassB x = new ClassC();
            ClassA z = new ClassC();

            y.AAA(); y.BBB(); y.CCC();

            /*ClassB AAA
            *  ClassB BBB
            *  ClassA CCC*/

            x.AAA(); x.BBB(); x.CCC();

            /*ClassB AAA
            *  ClassB BBB
            *  ClassA CCC*/
            z.AAA(); z.BBB(); z.CCC();

            /*ClassC AAA
            *  ClassA BBB
            *  ClassA CCC*/
            Console.ReadKey();
        }