java for each array element code example
Example 1: lopp array java
For(<DataType of array/List><Temp variable name> : <Array/List to be iterated>){
System.out.println();
//Any other operation can be done with this temp variable.
}
Example 2: for each loop java string array
//iteration by using the enhanced for loop provided by Java 5 or later
for (String str : strArray3) {
System.out.print(str);
}