How to use for each loop through an array in Java?
Answers
Answered by
1
For-each loop in Java. It starts with the keyword for like a normal for-loop. Instead of declaring and initializing a loop counter variable, you declare a variable that is the same type as the base type of the array, followed by a colon, which is then followed by the array name.....
HOPE IT HELPS YOU BUDDY.....
Answered by
0
Each Loop is another form of for loop used to traverse the array. for-each loop reduces the code significantly and there is no use of the index or rather the counter in the loop.
Hope it helps you :)
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Social Sciences,
1 year ago
English,
1 year ago
Math,
1 year ago