how to iterate through the list with for loop in java 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);
}