How to retrieve collection objects using Iterator? You can iterate through any collection object by using Iterator object. It provides two methods to iterate. The afrika dating kostenlos hasNext() method returns true if the iteration has more elements. The point rencontre 66 next() method returns the next element in the iteration.

para conocer gente de todo el mundo

follow url Below example shows how to iterate through an ArrayList.

mujer busca hombre ambato package pack2; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class IteratorExample { public static void main(String a[]){ List<String> myList = new ArrayList<String>(); myList.add("Java"); myList.add("Unix"); myList.add("Oracle"); myList.add("C++"); myList.add("Perl"); Iterator<String> itr = myList.iterator(); while(itr.hasNext()){ System.out.println(; } } }

follow url Output:

rencontres 55 ans et plus Java