Java 8's support for functional style programming

So, what is the foundation for functional style programming in Java 8? Well, it comes from a number of additions and modifications to the language. In this section, we will briefly introduce several concepts that Java 8 uses. These include:

  • Lambda expressions
  • Default methods
  • Functional interfaces
  • Method and constructor references
  • Collections

Understanding these concepts will enable you to understand their purpose and why they are used.

Lambda expressions

Lambda expressions are essentially anonymous functions. They can be considered to be one of the most significant additions to Java 8. They can make the code easier to write and read.

We have already seen a lambda expression in the previous examples. In ...

Get Learning Java Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.