示例#1
0
        void GreetAndFarewell(Salutation person)
        {
            Console.WriteLine(person.Greet());
            Console.WriteLine(person.Farewell());

            Console.WriteLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            // Use the Salutation class for a Walmart Greeter.
            Salutation oldGuy = new Salutation("Welcome to Walmart!", "Thanks for shopping at Walmart!");

            // Get the guy to talk...
            Console.WriteLine();
        }
示例#3
0
 private void Speak(Salutation speaker)
 {
     Console.WriteLine(speaker.Greet());
     Console.WriteLine(speaker.SayFareWell());
 }