Keeping up with the pace of a blog post a week I have wanted to take a closer look at Java 8 developer preview ever since it was release mid-November. Originally due to be in Java 7 but was dropped as part of the “Plan B” effort to help ship Java 7 earlier. Java 7 has now shipped and the focus is on the Java 8 which is due to be release late 2012. The syntax was finally confirmed after much debate by Brian Goetz on the lambda-dev mailing list and will adopt the C# syntax. For more information on Lambda expressions in Java 8 check out the JSR-335
Wait, let’s start at the start. What are lambda expressions and why oh why do we need them so badly that people fall out over the syntax.
What is a lambda expression?
Put simply a lambda expression is
Lambda is an operator used to denote anonymous functions
I just robbed that from Wikipedia, I surely can do better. In my words a lambda expression is
A succinct way to represent an anonymous method
My worst attempt at defining lambda expression was
Anonymous classes, but much cooler!!!
To find out how much cooler, read the full article:http://diarmuidmoloney.wordpress.com/2011/12/10/my-first-java-8-lambda-expression/ Edited by: Cameron McKenzie on Dec 12, 2011 12:58 PM