0

What is 'enhanced for' loop used for?

Also called 'for each' loop, is a completely different loop. but what is its purpose? what makes this different than any other loop?

21st Nov 2016, 2:16 PM
Hossain Abeer
Hossain Abeer - avatar
3 odpowiedzi
+ 1
it makes easier. especially for Array otherweise, u need more line:)
21st Nov 2016, 2:17 PM
Ozan Karataş
Ozan Karataş - avatar
0
A "for each" loop is used in normal array, List, Map, Vector.
21st Nov 2016, 11:12 PM
The PGDeveloper
The PGDeveloper - avatar
0
Enhanced for loops are simple. They can be used when you wish to step through the elements of the array in first-to-last order, and you do not need to know the index of the current element.
22nd Nov 2016, 4:40 PM
Malik Abdullah
Malik Abdullah - avatar