Java 8 comes with several new language features. First, there
is support for expressing anonymous functions: Java 8 has lambda expressions
and method/constructor references for this purpose. Second, interface methods
can have an implementation in Java 8: there are default methods and
static methods in interfaces in addition to the well-known abstract interface
methods.
Lambda expressions are essential in conjunction with new JDK abstractions
such as Stream, ComputableFuture and the like. These new JDK APIs
are clumsy to use without lambdas and method references. The non-abstract
interface methods were used for the design and implementation of the new
JDK APIs.
Independently of their use in conjunction with the JDK, the new language
features may change the way we design and implement our own APIs in the
future. They permit elegant new ways of designing Java APIs and novel
implementation techniques in Java. |