+ 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....

19th Jul 2018, 10:49 AM
mn121
mn121 - avatar
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.
19th Jul 2018, 11:03 AM
Moritz Vogel
Moritz Vogel - avatar