static void Main(string[] args) { NameRepository namesRepository = new NameRepository(); for (IIterator iter = namesRepository.GetIterator(); iter.HasNext();) { String name = (String)iter.Next(); Console.WriteLine("Name : " + name); Console.ReadKey(); } }
static void Main() { NameRepository namesRepository = new NameRepository(); IIterator iter = namesRepository.GetIterator(); while (iter.HasNext()) { string name = (string)iter.Next(); Console.WriteLine("Name : " + name); } }
public static void Demo() { NameRepository nr = new NameRepository(); //NameRepository.NameIterator ni = new NameRepository.NameIterator(); for (Iterator i = nr.GetIterator(); i.HasNext();) { Console.WriteLine(i.Next()); } Console.ReadLine(); }