Beispiel #1
0
        // Exercise 1 demonstrates inheritance and polymorphism
        public void RunExerciseOne()
        {
            Airplane airplane = new Airplane();
            Airplane jet = new Jet();

            airplane.setSpeed(20);
            Console.WriteLine(airplane.getSpeed());

            jet.setSpeed(30);
            Console.WriteLine(jet.getSpeed());
        }
Beispiel #2
0
        // Exercise 1 demonstrates inheritance and polymorphism
        public void RunExerciseOne()
        {
            Airplane airplane = new Airplane();
            Airplane jet      = new Jet();

            airplane.setSpeed(20);
            Console.WriteLine(airplane.getSpeed());

            jet.setSpeed(30);
            Console.WriteLine(jet.getSpeed());
        }