Skip to Content
Functional Programming in Java
book

Functional Programming in Java

by Venkat Subramaniam
February 2014
Intermediate to advanced
160 pages
4h 59m
English
Pragmatic Bookshelf
Content preview from Functional Programming in Java

Using Function Composition

The OOP paradigm helps us realize abstraction, encapsulation, and polymorphism; inheritance is the weakest link in the paradigm. When programming in the functional style we compose higher-order functions, and as much as possible, promote immutability and functions. We can leverage our experience with OOP, and at the same time use the elegant functional style that is new in Java.

Let’s get a feel for object transformation. Suppose we need change, and we ask a friend to break a $10 bill. We don’t expect our buddy to tear up the bill and return the pieces. Instead, we’d like the bill to disappear into our friend’s pocket and some smaller bills to appear. Mixing OOP and functional style is like that; we send lightweight ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in Java

Functional Programming in Java

Pierre-Yves Saumont

Publisher Resources

ISBN: 9781941222690Errata Page