Java examples for Lambda Stream:Method Reference
Pass method to Stream forEach action via method reference
import java.util.stream.Stream; /**/*from w w w. j a v a2 s . co m*/ * Starting point of the application */ public class BlogMain { private final String[] BLOG_ENTRIES = {"First Note", "Another Note", "End"}; public static void main(String[] args) { System.out.println("Blog up and running"); new BlogMain().printAllNotes(); } public void printAllNotes(){ Stream.of(BLOG_ENTRIES).forEach(System.out::println); } }