Method Reference in Java 8

In the place of an Anonymous class we can use Lambda expression but Sometimes, the lambda expression does nothing but call an existing method. In those cases, it’s often clearer to refer to the existing method by its name. Method references enable you to do this; A method reference is a shorthand syntax for a lambda expression that executes only One method. We can Use it if we need to declare fields or additional methods. Syntax :   Object :: methodName   Note: In the place of an Anonymous class we can use Lambda Expression, In the place of a Read More …

Share Knowledge

Why Java 8 ?

With this new release, Java 8 is introducing a completely new JVM with full packed of some really exciting features at both the JVM and programming language level. There are literally dozens of new features that make java even better than previous versions and improvement about performance and optimized coding level with some functional programming features. These additions are under-the-hood improvements either at the compiler, JVM or help-system level. Lambda Expression and Virtual Extension Methods are the highlighting feature of Java 8 which is the implementation of Lambda expressions and supporting features to the Java programming language and platform. To Read More …

Share Knowledge