Chapter 6Lambdas and Functional Interfaces

OCP exam objectives covered in this chapter:

  • images  Programming Abstractly Through Interfaces
    • Declare and use List and ArrayList instances
    • Understanding Lambda Expressions

images When we covered the Java APIs in the previous chapter, we didn’t cover the ones that use lambda syntax. This chapter remedies that! You’ll learn what a lambda is used for, about common functional interfaces, how to write a lambda with variables, and the APIs on the exam that rely on lambdas.

Writing Simple Lambdas

Java is an object-oriented ...

Get OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.