How enhanced loop statement works?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How enhanced loop statement works??

8th Aug 2016, 8:13 PM
Neeraj Rawat
Neeraj Rawat - avatar
4 Answers
+ 4
The sentence looks like this: for(obj i : array). It goes through each element of array and assigns the value of the element to i. This is a good way to implement a loop without having to know the length of the array
8th Aug 2016, 10:13 PM
Daniel Santil
Daniel Santil - avatar
0
How value of i is changing??
9th Aug 2016, 6:56 AM
Neeraj Rawat
Neeraj Rawat - avatar
0
still I didn't get how I value become a change in this loop..
27th Aug 2016, 8:30 AM
Preeti Khavekar
0
it doesn't change , it take the value from the array
22nd Sep 2016, 5:39 PM
Loai
Loai - avatar