Home / Java Tips Generated By ChatGPT / forEach Loop in Java The forEach method in the Iterable interface allows you to iterate over collections more elegantly, using lambda expressions. Source Code List list = Arrays.asList("Apple", "Banana", "Cherry"); list.forEach(item -> System.out.println(item));