Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The enhanced for loop (or for-each loop) is a simplified loop structure introduced in Java that allows easy iteration over arrays or collections without explicitly managing an index or iterator.
Related terms
Loop: A loop is a programming construct that allows repeated execution of a block of code until a certain condition is met.
An array is a data structure that stores a fixed-size sequence of elements of the same type.
Collection: In Java, a collection refers to an object that groups multiple elements together, providing various methods for manipulation and traversal.
"Enhanced For Loop (For-each Loop)" also found in: