Skip to Content
The Java Workshop
book

The Java Workshop

by David Cuartielles, Pradeep Kumar Gupta, Scott Cosentino, Andreas Göransson, Eric Foster-Johnson, Avinash Kate
October 2019
Beginner
606 pages
10h 37m
English
Packt Publishing
Content preview from The Java Workshop

16. Predicates and Other Functional Interfaces

Overview

This chapter explores all the valid use cases of functional interfaces. It will first define what these interfaces are (beginning with the predicate interface), as well as how best to employ them in your code. You will then learn how to build and apply predicates, studying their composition and how to use this to model complex behavior. You will practice creating consumer interfaces to change the state of your program, and, eventually, use functions to extract useful constructs.

Introduction

Alongside the many other improvements in Java 8 (such as the streaming API, method references, optionals, and collectors) there are interface improvements that allow default and static methods ...

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

Modern Java Collections

Modern Java Collections

Simon Roberts
Java By Comparison

Java By Comparison

Simon Harrer, Linus Dietz, Jörg Lenhard

Publisher Resources

ISBN: 9781838986698Supplemental Content