+ 1
What do we mean by 'enhanced for loop' or 'for each loop' in java?
I can't understand the definition given in the. java course in the array part....
1 Réponse
0
The enhanced for loop just assigns the value of an object in an array to a variable.
for(int i : myArray){}
This loop will iterate through the integer array myArray and will assign the value of the current int of the array to the variable i. It runs until it iterated through all the values.