Esempio n. 1
0
        // Output:
        // TestCars3
        // ----------
        // A roof that opens up.
        // Carries seven people.
        public static void TestCars3()
        {
            System.Console.WriteLine("\nTestCars3");
            System.Console.WriteLine("----------");
            ConvertibleCar car2 = new ConvertibleCar();
            Minivan        car3 = new Minivan();

            car2.ShowDetails();
            car3.ShowDetails();
        }
Esempio n. 2
0
        //<snippet72>
        public static void TestCars1()
        {
            System.Console.WriteLine("\nTestCars1");
            System.Console.WriteLine("----------");

            Car car1 = new Car();

            car1.DescribeCar();
            System.Console.WriteLine("----------");

            // Note the output from this test case. The ShowDetails method is
            // declared with the new modifier.
            ConvertibleCar car2 = new ConvertibleCar();

            car2.DescribeCar();
            System.Console.WriteLine("----------");

            Minivan car3 = new Minivan();

            car3.DescribeCar();
            System.Console.WriteLine("----------");
        }
Esempio n. 3
0
        // Output:
        // TestCars1
        // ----------
        // Four wheels and an engine.
        // Standard transportation.
        // ----------
        // Four wheels and an engine.
        // Standard transportation.
        // ----------
        // Four wheels and an engine.
        // Carries seven people.
        // ----------
        public static void TestCars1()
        {
            System.Console.WriteLine("\nTestCars1");
            System.Console.WriteLine("----------");

            Car car1 = new Car();

            car1.DescribeCar();
            System.Console.WriteLine("----------");

            // Notice the output from this test case. The new modifier is
            // used in the definition of ShowDetails in the ConvertibleCar
            // class.
            ConvertibleCar car2 = new ConvertibleCar();

            car2.DescribeCar();
            System.Console.WriteLine("----------");

            Minivan car3 = new Minivan();

            car3.DescribeCar();
            System.Console.WriteLine("----------");
        }