how to iterate list in java using for each loop code example
Example 1: java loop through list
for (E element : list) {
. . .
}
Example 2: iterate list in java
Iterator itr=list.iterator();
while(itr.hasNext)
{
system.out.println(itr.next);
}