OpenJDK Java8 Lambda Syntax
This document provides some working examples of the future OpenJDK 8 lambda syntax. There was a lot of discussion whether the language changes would get included in the Java7 or Java8 so it looks like we will see the changes in Java8 slated for release in 2013. The lambda conversion uses a target SAM type or single abstract method. You can see the conversion in this example: interface F { void f(); } final F func = () -> System.out.println("Test"); System.out.println("Function Object : " + func); func.f(); ... The variable type on the left is an interface of type 'F' with a single method 'f'. It seems that the Java lambda implementation provides a slightly more expressive syntax for code blocks that you would normally see in an anonymous inner class. These sections of code are synonymous. ...