using System;
namespace C15_1
{
public enum Language
{
English, Chinese
}
public class ManagerHello
{
private void EnglishGreeting(string name)
{
Console.WriteLine("Hello " + name);
}
private void ChineseGreeting(string name)
{
Console.WriteLine("你好 " + name);
}
public void GreetHello(string name, Language lang)
{
switch (lang)
{
case Language.English:
EnglishGreeting(name);
break;
case Language.Chinese:
ChineseGreeting(name);
break;
}
}
}
}
沒有留言:
張貼留言