static void Main(string[] args) { NameRepository nameRepository = new NameRepository(); for (IIterator iterator = nameRepository.GetIterator(); iterator.HasNext();) { String name = iterator.Next() as String; Console.WriteLine("Name: " + name); } }
static void Main(string[] args) { NameRepository nameRepository = new NameRepository(); IIterator iter = nameRepository.Iterator(); while (iter.HasNext()) { Console.WriteLine((string)iter.Next()); } }
public static void Main(string[] args) { NameRepository namesRepository = new NameRepository(); for (Iterator iter = namesRepository.getIterator(); iter.hasNext();) { string name = (string)iter.next(); Console.WriteLine("Name : " + name); } }
static void Main(string[] args) { var namesRepository = new NameRepository(); for (var iter = namesRepository.GetIterator(); iter.HasNext();) { var name = iter.Next(); Console.WriteLine($"Name : {name}"); } Console.ReadKey(); }
public NameIterator(NameRepository o) => outer = o;