Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Car car1 = new Car()
            {
                _model          = "Audi R8",
                _numberOfDoors  = 2,
                _numberOfWheels = 4
            };

            Car car2 = new Car()
            {
                _model          = "Lamborghini veneno",
                _numberOfDoors  = 2,
                _numberOfWheels = 4
            };

            Motorcycle motor = new Motorcycle()
            {
                _model              = "Roadster",
                _numberOfWheels     = 2,
                _numberOHandBreakes = 2
            };

            Motorcycle motor2 = new Motorcycle()
            {
                _model              = "FXDR 114",
                _numberOfWheels     = 2,
                _numberOHandBreakes = 2
            };

            Vehice[] vehicle = new Vehice[3];
            vehicle[0] = car1;
            vehicle[1] = car2;
            vehicle[2] = motor;
            vehicleArray(vehicle);

            Carrier c = new Carrier()
            {
                _car   = car1,
                _motor = motor2
            };
        }
Ejemplo n.º 2
0
 public void PrintVehile(Vehice vehicle)
 {
     Console.WriteLine(vehicle.ToString());
 }