for each loop java for string list code example
Example 1: java loop through arraylist
ArrayList<String> namesList = new ArrayList<String>(Arrays.asList( "alex", "brian", "charles") );
for(String name : namesList)
{
System.out.println(name);
}
Example 2: java for each
//itemset contains variables of type <Data Type>
for(<Data Type> item : itemset) {
//loop
}