static void Main(string[] args)
        {
            Car car = new Car(VehicleFuelType.Petrol, 20);

            Console.Out.WriteLine("Vehicle Type: {0}", car.Type);
            Van van = new Van(VehicleFuelType.Diesel, 40);

            Console.Out.WriteLine("Vehicle Type: {0}", van.Type);
            Console.ReadLine();
        }
Пример #2
0
        // Randomness removed: you want a driver to **consistently** pass or fail.
        static void Main(string[] args)
        {
            Car car = new Car(VehicleFuelType.Petrol, 20);

            // The first arg specifies format/placement of the second
            Console.Out.WriteLine("Vehicle Type: {0}", car.Type);
            // In background, uses String.Format()
            // See https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx
            Van van = new Van(VehicleFuelType.Diesel, 40);

            Console.Out.WriteLine("Vehicle Type: {0}", van.Type);
            Console.ReadLine();
        }