Beispiel #1
0
        static void Main(string[] args)
        {
            Car thecar = new CompactCar();

            thecar = new Navigation(thecar);
            thecar = new LeatherSeats(thecar);
            thecar = new Sunroof(thecar);

            Console.WriteLine(thecar.GetDescription());
            Console.WriteLine(thecar.GetPrice());
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Car myCar = new CompactCar();

            myCar = new LeatherSeats(myCar);
            myCar = new Navigation(myCar);
            myCar = new Sunroof(myCar);

            Console.WriteLine("Description of the car is {0}", myCar.GetDescription());
            Console.WriteLine("The price of the car is {0}", myCar.GetCarPrice());
        }