Appendix 8 Introduction to Java 8 Functional Programming

Functional programming was introduced in Java 8. The core addition is functional programming with lambda expressions. In this appendix we describe the benefits of functional programming and give a few examples of the programming style. Most of the Java 8 features are more appropriate for an advanced Java text but the concepts apply to material we have discussed, particularly in the context of the Collections framework covered in Chapter 12 or to event handlers for JavaFX applications.

A lambda expression is a nameless function. In functional programming, a function is the same thing as a method. Related concepts you may hear about include closures, anonymous functions, and function literals. ...

Get Java: An Introduction to Problem Solving and Programming, 8th Edition 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.