示例#1
0
 static void Main(string[] args)
 {
     Beverage beverage = new DarkRoast();
     beverage = new MilkShot(beverage);
     beverage = new Mocha(beverage);
     Console.WriteLine(string.Format("{0}: {1}", beverage.GetDescription(), beverage.GetCost()));
 }
示例#2
0
        static void Main(string[] args)
        {
            Beverage beverage = new DarkRoast();

            beverage = new MilkShot(beverage);
            beverage = new Mocha(beverage);
            Console.WriteLine(string.Format("{0}: {1}", beverage.GetDescription(), beverage.GetCost()));
        }