A default method, another new feature in Java 8, is a method in an interface with a default implementation.
Collection classes that implement Iterable (for example, all list and set classes) now have a forEach() method. This method takes a single parameter that is a functional interface. Therefore the actual parameter passed to the forEach() method is a candidate for a lambda expression. Using the features of Java 8, our running example would evolve to the form shown in Listing 4.
Iteration in Java 8 using the forEach() method
List<String> emails = new LinkedList<>(); //add some items to the collection emails.forEach(email -> System.out.println(email));