Iterator
iterator is an object that traverse a container, like string or lists. The most fundamental methods provided by an iterator are hasNext(), which returns a boolean value indicating whether the container has more elements or not, and next(), which returns an element in that container, and then move to the next. Java has a built-in iterator class and many classes, like arrayList, have an associated iterator.
Loop through a list Useful info: Java provides a simpler way to loop through a list, the for each loop The common usage is like for(datatype element: list){ (loop body) } Useful info: http://docs.oracle.com/javase/1.5.0/docs/gui de/language/foreach.html