Java Reference
In-Depth Information
PlayerFactory player1 = Player::new;
Player newPlayer = player1.createPlayer("CENTER", 0,
"Constructor", "Referenceson");
Method references are perhaps one of the most significant new features of Java 8,
although lambda expressions have more use-cases. They provide an easy-to-read, sim-
plified technique for generating lambda expressions, and they'll work in most cases
where a lambda is merely invoking a single method by name.
Summary
It is not very often that a new construct added to a language can have as large of an im-
pact as lambda expressions to Java. For years, developers have been utilizing such con-
structs as anonymous inner classes to add subtle functionality to applications. With the
addition of lambda expressions, that subtle functionality can be developed with easy-
to-read code, rather than redundant and difficult-to-read boilerplate code. Moreover,
many languages today make it possible to pass functional pieces of code around, dy-
namically altering the functionality of existing code. Such solutions are now available
in the Java language, allowing developers to make use of more modern programming
techniques.
Lambda expressions bring new life to the Java language, providing capabilities that
Java developers have not had in the past. Developers of desktop, mobile, and enterprise
applications alike will be able to take advantage of the lambda expression to create
more robust and sophisticated solutions. Lambda expressions are a revolutionary
change to the language, and they have a significant impact on development across the
platform.
Search WWH ::




Custom Search