static void Main(string[] args) { Factory factory = new Factory(); IPeople people = factory.GetPeople(PeopleType.URBAN); Console.WriteLine(people.GetName()); people = factory.GetPeople(PeopleType.RURAL); Console.WriteLine(people.GetName()); Console.ReadKey(); }
static void Main1() { Factory factory = new Factory(); IPeople ruralPeople = factory.GetPeople(PeopleType.RURAL); Console.WriteLine(ruralPeople.GetName()); IPeople urbanPeople = factory.GetPeople(PeopleType.URBAN); Console.WriteLine(urbanPeople.GetName()); Console.ReadKey(); }