Home / Java Tips Generated By ChatGPT / Looping Through an ArrayList with for-each in Java For-each provides a concise way to iterate through collections like ArrayList. Source Code ArrayList cars = new ArrayList(List.of("Volvo", "BMW", "Ford")); for (String car : cars) { System.out.println(car); }