Home / Java Tips Generated By ChatGPT / Enhanced for Loop (For-Each) in Java The enhanced for loop is useful for iterating through arrays and collections. Source Code String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; for (String i : cars) { System.out.println(i); }