16 May 2014

This is my first encounter with Java 8’s lambdas. To use a lambda I created a functional interface. Conceptually, a functional interface has exactly one abstract method.

I then created a Test class that uses an anonymous class as well as a lambda expression to achieve the same result (printing out the function invocation).

The resulting output will be:

Function invoked using Anonymous class

Function invoked using Lambda expression



blog comments powered by Disqus