-
Book Overview & Buying
-
Table Of Contents
Learning Java Lambdas
By :
Java 8 was released on March 18, 2014, two years seven months after the previous release. It was plagued with delays and technical problems but when it finally came, it represented one of the biggest shifts in Java since Java 5.
The headliners were of course lambdas and a retrofit to support functional programming ideas. With languages such as Scala taking center stage and the modern trend towards functional programming, Java had to do something to keep up.
Although Java is not and never will be a pure functional programming language, the changes in Java 8 enabled developers to use functional idioms more easily than in previous versions. With discipline and experience, you can now get a lot of the benefits of functional programming without resorting to third-party libraries.
To give you an idea of just how big a change Java 8 was, and why it ushered in a new, modern Java, here's a mostly complete list of the new features it introduced:
map and flatMap from the stream API enable a declarative way to process lists and move away from external iteration to internal iteration. This in turn allows the library vendors to worry about the details and optimize processing however they like. For example, Java now comes with a parallel way to process streams without bothering the developer with the details.Optional class will be familiar to some, and it enables a better way to deal with nulls.Joda-time library).IO and NIO packages received welcome additions to enable working with IO streams using the new streams API.Change the font size
Change margin width
Change background colour