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

            theCar = new Sunroof(theCar);

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

            compactCar = new Navigation(compactCar);
            compactCar = new Sunroof(compactCar);

            Console.WriteLine(compactCar.GetDescription());
            Console.WriteLine(compactCar.GetPrice());

            Console.ReadLine();
        }