コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hallo Deco");

            var lecker1 = new Käse(new Käse(new Salami(new Käse(new Pizza()))));

            Console.WriteLine($"Lecker 1: {lecker1.Name} {lecker1.Preis}");

            Console.ReadKey();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            var brot = new Käse(new Brot());

            Console.WriteLine($"{brot.Name} {brot.Preis:c}");

            var pizza = new Salami(new Käse(new Käse(new Pizza())));

            Console.WriteLine($"{pizza.Name} {pizza.Preis:c}");

            Console.WriteLine("Ende");
            Console.ReadKey();
        }