Beispiel #1
0
        public static void Main()
        {
            Doctor d;

            d = new Consultant("Dr. Jeans", "Ped", 10, 500);
            d.Print();  // Print of Consultant  - Runtime Polymorphism
            Console.WriteLine("Payment  : {0}", d.GetPayment());

            d = new RDoctor("Dr. Andy", "Card", 300000);
            d.Print();  // Print of RDoctor - Runtime Polymorphism
            Console.WriteLine("Payment  : {0}", d.GetPayment());
        }
Beispiel #2
0
        public static void Main()
        {
            Doctor d;

            d = new Consultant("Dr. Jeans", "Ped", 10, 500);
            d.Print();  // Print of Consultant  - Runtime Polymorphism
            Console.WriteLine("Payment  : {0}", d.GetPayment());

            d = new RDoctor("Dr. Andy", "Card", 300000);
            d.Print();  // Print of RDoctor - Runtime Polymorphism
            Console.WriteLine("Payment  : {0}", d.GetPayment());
        }