Skip to Content
Modern Java in Action
book

Modern Java in Action

by Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft
October 2018
Intermediate to advanced
592 pages
19h 49m
English
Manning Publications
Content preview from Modern Java in Action

Chapter 3. Lambda expressions

This chapter covers

  • Lambdas in a nutshell
  • Where and how to use lambdas
  • The execute-around pattern
  • Functional interfaces, type inference
  • Method references
  • Composing lambdas

In the previous chapter, you saw that passing code with behavior parameterization is useful for coping with frequent requirement changes in your code. It lets you define a block of code that represents a behavior and then pass it around. You can decide to run that block of code when a certain event happens (for example, a button click) or at certain points in an algorithm (for example, a predicate such as “only apples heavier than 150 g” in the filtering algorithm or the customized comparison operation in sorting). In general, using this concept ...

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

The Well-Grounded Java Developer, Second Edition

The Well-Grounded Java Developer, Second Edition

Benjamin Evans, Martijn Verburg, Jason Clark
Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan
Java in a Nutshell, 7th Edition

Java in a Nutshell, 7th Edition

Benjamin J. Evans, David Flanagan
Java Coding Problems

Java Coding Problems

Anghel Leonard

Publisher Resources

ISBN: 9781617293566Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link