O'Reilly logo

OCP Oracle® Certified Professional Java® SE 8 Programmer II by Scott Selikoff, Jeanne Boyarsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4 Functional Programming

THE OCP EXAM TOPICS COVERED IN THIS CHAPTER INCLUDE THE FOLLOWING:

  • ✓  Generics and Collections
    • Collections Streams and Filters
    • Iterate using forEach methods of Streams and List
    • Describe Stream interface and Stream pipeline
    • Use method references with Streams
  • ✓  Lambda Built-In Functional Interfaces
    • Use the built-in interfaces included in the java.util.function package such as Predicate, Consumer, Function, and Supplier
    • Develop code that uses primitive versions of functional interfaces
    • Develop code that uses binary versions of functional interfaces
    • Develop code that uses the UnaryOperator interface
  • ✓  Java Stream API
    • Develop code to extract data from an object using peek() and map() methods including primitive versions of the map() method
    • Search for data by using search methods of the Stream classes including findFirst, findAny, anyMatch, allMatch, and noneMatch
    • Develop code that uses the Optional class
    • Develop code that uses Stream data methods and calculation methods
    • Sort a collection using Stream API
    • Save results to a collection using the collect method and group/partition data using the Collectors class
    • Use of merge() and flatMap() methods of the Stream API

images

By now, you should be comfortable with the lambda and method reference syntax. Both are used when implementing functional interfaces. If you aren’t comfortable with this, go back ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required