Home / Java Tips Generated By ChatGPT / Enhanced for Loop for Arrays in Java The enhanced for loop is ideal for iterating through arrays/collections without using an index variable. Source Code String[] cars = {"Volvo", "BMW", "Ford"}; for (String car : cars) { System.out.println(car); }