Lambdas vs closures
The terms closure and lambda are often used interchangeably but they are actually distinct. In this section we'll take a look at the differences so you can be clear about which is which.
Below is a table showing the release dates for each major version of Java. Java 5.0 came along in 2004 and included the first major language changes including things like generics support:
Around 2008 to 2010 there was a lot of work going on to introduce closures to Java. It was due to go in to Java 7 but didn't quite make it in time. Instead it evolved into lambda support in Java 8. Unfortunately, around that time, people used the term "closures" and "lambdas" interchangeably and so it's been a little confusing for the Java community since. In fact, there's still a project page on the OpenJDK site for closures and one for lambdas.
From the OpenJDK project's perspective, they really should have been using "lambda" consistently from the start. In fact, the OpenJDK got it so wrong, they...