small medium large xlarge

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions


Cover image for Functional Programming in Java
Pages 196
Release P1.0 (2014-03-19)
ISBN 978-1-93778-546-8

Get ready to program in a whole new way. Functional Programming in Java will help you quickly get on top of the new, essential Java 8 language features and the functional style that will change and improve your code. This short, targeted book will help you make the paradigm shift from the old imperative way to a less error-prone, more elegant, and concise coding style that’s also a breeze to parallelize. You’ll explore the syntax and semantics of lambda expressions, method and constructor references, and functional interfaces. You’ll design and write applications better using the new standards in Java 8 and the JDK.

Choose Your Format(s)
  • $41.00 In Stock

    Save $13.00 on the combo pack.

  • $33.00 In Stock
  • $21.00 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

About This Title

This BookBeginnerExpert

Lambda expressions are lightweight, highly concise anonymous methods backed by functional interfaces in Java 8. You can use them to leap forward into a whole new world of programming in Java. With functional programming capabilities, which have been around for decades in other languages, you can now write elegant, concise, less error-prone code using standard Java. This book will guide you though the paradigm change, offer the essential details about the new features, and show you how to transition from your old way of coding to an improved style.

In this book you’ll see popular design patterns, such as decorator, builder, and strategy, come to life to solve common design problems, but with little ceremony and effort. With these new capabilities in hand, Functional Programming in Java will help you pick up techniques to implement designs that were beyond easy reach in earlier versions of Java. You’ll see how you can reap the benefits of tail call optimization, memoization, and effortless parallelization techniques.

Java 8 will change the way you write applications. If you’re eager to take advantage of the new features in the language, this is the book for you.

Read the reviews .

You Might Also Like

  • Cover Image For Programming Groovy 2…
  • Cover Image For Programming Clojure…
  • Cover Image For Programming Elixir…
  • Cover Image For Seven Concurrency Models in Seven Weeks…
  • Cover Image For Functional Programming Patterns in Scala and Clojure…

What You Need

Java 8 with support for lambda expressions and the JDK is required to make use of the concepts and the examples in this book.


Each of our books has its own dedicated discussion area, where readers help each other out. Many authors also choose to drop by.

Join in…

Here are some recent topics:

Contents & Extracts

  • Hello Lambda Expressions excerpt
    • Why embrace another paradigm?
    • Benefits of Functional Style
    • Using Functional Style as a Power Tool
    • Evolving from Imperative to Functional Style
    • Syntax Sugar with Functional Interfaces
    • Recap
  • Using Collections
    • Iterating a List
    • Transforming a List
    • Finding Elements
    • Reusing Lambda Expressions
    • Using Lexical Scoping and Closures
    • Picking an Element
    • Reducing a Collection to a Single Value
    • Joining Elements
    • Recap
  • Strings, Comparators, and Filters excerpt
    • Iterating a String
    • Implementing Comparator
    • Multiple and Fluent Comparisons
    • Listing All Files in a Directory
    • Listing Select Files in a Directory
    • Watching a File Change
    • Recap
  • Designing with Lambda Expressions
    • Separating Concerns using Lambda Expressions
    • Delegating using Lambda Expressions
    • Decorating using Lambda Expressions
    • A Peek into default Methods
    • Creating Fluent Interfaces using Lambda Expressions
    • Recap
  • Working with Resources
    • Cleaning up Resources
    • Using Lambda Expressions to Clean Up Resources
    • Managing Locks
    • Creating Concise Exception Tests
    • Recap
  • Being Lazy
    • Delayed Initialization
    • Lazy Evaluations
    • Leveraging the Laziness of Streams
    • Creating Infinite, Lazy Collections
    • Recap
  • Optimizing Recursions
    • Using Tail Call Optimization
    • Speeding up with Memoization
    • Recap
  • Composing with Lambda Expressions
    • Using Function Composition
    • Using Map Reduce
    • Talking a Leap to Parallelize
    • Recap
  • Bringing it all Together
    • Essential Practices to Succeed with Functional Style
    • Performance Concerns
    • Adopting Functional Style
  • Starter Set of Functional Interfaces
    • Consumer
    • Supplier
    • Predicate
    • Function
  • Syntax Overview
    • Defining a Functional Interface
    • Creating No-parameter Lambda Expressions
    • Creating a Single Parameter Lambda Expression
    • Inferring a Lambda Expression’s Parameter Type
    • Dropping Parenthesis for Single Parameter Inferred Type
    • Creating a Multi-Parameters Lambda Expression
    • Calling a Method With Mixed Parameters
    • Storing Lambda Expression
    • Creating a Multiline Lambda Expression
    • Returning a Lambda Expression
    • Returning a Lambda Expression from a Lambda Expression
    • Lexical Scoping in Closures
    • Passing a Method Reference of an Instance Method
    • Passing a Method Reference to a static Method
    • Passing a Method Reference to a Method on Another Instance
    • Passing a Method Reference of a Method That Takes Parameters
    • Using a Constructor Reference
    • Function Composition
  • Web Resources

Brought to You By

Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and a professor at the University of Houston. He’s a regularly invited speaker at international conferences, a Java Champion, and has received the JavaOne Rockstar award multiple times.