6.7. Simple lambda expressions
[9.5] Write a simple Lambda expression that consumes a Lambda Predicate expression
This exam includes working with simple lambda expressions to enable you to get started with functional-style programming in Java. Functional programming enables you to write declarative code. It lets you define what to do, rather than focusing on how to do it. With functional programming, you can pass code to your methods as arguments. Let’s get the hang of it by comparing passing of variable or literal values to methods with passing code to them.
6.7.1. Comparing passing values with passing code to methods
Imagine that you need to write methods to print values of a range of numbers, like 1 to 10, 10 to 20, and ...
Get OCA Java SE 8 Programmer I Certification Guide 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.