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); } }
static void Main(string[] args) { var namesRepository = new NameRepository(); for (IIterator iter = namesRepository.getIterator(); iter.hasNext();) { var name = iter.next().ToString(); Console.WriteLine($"Name: {name}"); } Console.ReadLine(); }
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(); }
public NameIterator(NameRepository _nameRepository) { nameRepository = _nameRepository; }