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()); }
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()); }