Getting Started with Lambda Expressions in Java 8

Lambda Expressions are introduced in Java 8 and is the most prominent feature in this release of Java. This blog is a tutorial of Lambda Expression which will take you through all the details. At the end, you will be able to kick start using Lambda Expressions in your day to day programs.

What is Lambda Expression ?

Lambda expressions are expressions that aims to reduce writing clumsy code. Lambda expressions do not do technically anything new that couldn't be done before Java 8. Lambda expressions has following syntax :

(parameter1, parameter2 ...)                   ->                      (statements or expressions)
                                    (First Part)                 (Second Part)               (Third Part)

First Part      : Input parameters containing variables that will be used in Third part.
Second Part  : This is called as Arrow Token (A hyphen followed by right angle bracket)
Third Part     : Code statements to be executed

☺Don't worry if you don't get much out of above syntax. It's very easy and will be much clearer as we move ahead.

Comments

Popular posts from this blog

Why do I get Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg

Preparing applications for migration to Oracle 11G from Oracle 10G

Getting started with Weblogic Maven Plugin