Example #1
0
        static void Main(string[] args)
        {           //NEW METHOD USED FLAVOR & LOVING
            Pineapple PA = new Pineapple("Mrs. Pineknickle", "papple", "yellow", "happy");

            PA.flavor("Mrs. Pineapple smells sweet");
            PA.loving("Mrs. Pineapple hair is shaped like a flower");
        }
Example #2
0
        static void ShowPolymorphism()
        {
            Fruit f;

            f = new Apple();
            //这句输出什么?
            f.GrowInArea();
            f = new Pineapple();
            //与前面相同的代码,输出什么?
            f.GrowInArea();
        }