search for field name in a list using advanced loop java code example
Example 1: iterate a list using iterator
Iterator<String> crunchifyIterator = crunchifyList.iterator();
while (crunchifyIterator.hasNext()) {
System.out.println(crunchifyIterator.next());
}
Example 2: enhanced for loop arraylist
// for(dataType var: myArrayList){
// System.out.println(var);
// }
for(int num: numList){
System.out.println(num);
}