Chapter 9. Functional Programming Techniques: Functional Interfaces, Streams, Parallel Collections

Introduction

Java is an object-oriented (OO) language. You know what that is. Functional Programming (FP) has been attracting attention lately. There may not be quite as many definitions of FP as there are FP languages, but it’s close. Wikipedia’s definition of Functional Programming is …

“… a programming paradigm, a style of building the structure and elements of computer programs, that treats computation as the evaluation of mathematical functions and avoids state and mutable data. Functional programming emphasizes functions that produce results that depend only on their inputs and not on the program state - i.e. pure mathematical functions. It is a declarative programming paradigm, which means programming is done with expressions. In functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) both times. Eliminating side effects, i.e. changes in state that don’t depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming…”

http://bit.ly/1eUS2QP viewed December 2013

How can we benefit from the FP paradigm? ...

Get Java Cookbook, 3rd 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.