foreach java list code example
Example 1: java foreach list
list.forEach((MyType myObject) -> {/* code */});
Example 2: java loop through list
for (E element : list) {
. . .
}
Example 3: iterate a list using iterator
Iterator<String> crunchifyIterator = crunchifyList.iterator();
while (crunchifyIterator.hasNext()) {
System.out.println(crunchifyIterator.next());
}