Monthly Archives: August 2017

For Each Java8

import java.util.ArrayList; import java.util.List; import org.testng.annotations.Test; public class TestLambda { @Test public void testForEach() { List<String> list1=new ArrayList<String>(); list1.add(“Sai”); list1.add(“Sainath”); list1.add(“Sairam”); list1.forEach(item->System.out.println(item)); } } Advertisements

Posted in Java, Uncategorized | Leave a comment