Answer:
In Java, the for-each loop is used to iterate through elements of arrays and collections (like ArrayList)
Step-by-step explanation:
The syntax of the Java for-each loop is:
for(dataType item : array) {
...
}
Here,
array - an array or a collection
item - each item of array/collection is assigned to this variable
dataType - the data type of the array/collection