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(); for (IIterator iter = nameRepository.GetIterator(); iter.hasNext();) { string name = (string)iter.next(); Console.WriteLine("Name: " + name); } Console.Read(); }
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(); }