devxlogo

August 1, 2017

New Way to Iterate a List in Java 8

We can see that the method println is referred by System.out using :: import java.util.*;public class NewForEach { public static void main(String args[]) { List empNames = new ArrayList(); empNames.add(“Andrew”);