0

A FOR loop (enhanced for loop) can only be used with arrays?

Java. For example, for(int i:arr){}

12th Mar 2017, 8:25 AM
Dmitry Solovyov
Dmitry Solovyov - avatar
2 odpowiedzi
+ 1
Nop, it's possibile to use this loop also for Collection objects and derivates.
12th Mar 2017, 8:48 AM
Giampaolo Bolzonella
Giampaolo Bolzonella - avatar
0
no,other loops can also be used with arrays, for example the do while loop can also be used
1st Apr 2017, 2:58 PM
Juniorbuba
Juniorbuba - avatar