For-each loop —
is an enhanced version of the for loop, designed specifically for iterating over arrays and collections in a clean, concise manner.
for (ElementType element : collection) {
// Loop body
}
String[] fruits = {"Apple", "Banana", "Cherry"};
for (String fruit : fruits) {
System.out.println(fruit);
}