OCPJP 8 Upgrade from Java 7 Topics

Lambda Expressions

Using Built-in Lambda Types

Java Collections and Streams with Lambdas

  • Develop code that iterates a collection by using the forEach() method and method chaining
  • Describe the Stream interface and pipelines
  • Filter a collection by using lambda expressions
  • Identify the operations, on stream, that are lazy

Collection Operations with Lambda

  • Develop code to extract data from an object by using the map() method
  • Search for data by using methods such as findFirst(), findAny(), anyMatch(), allMatch(), and noneMatch()
  • Describe the unique characteristics of the Optional class
  • Perform calculations by using Java Stream methods, such as count(), max(), min(), average(), and sum()
  • Sort a collection by using lambda expressions
  • Develop code that uses the Stream.collect() method and Collectors class methods, such as averagingDouble(), groupingBy(), joining(), and partitioningBy()

Parallel Streams

  • Develop code that uses parallel streams
  • Implement decomposition and reduction in streams

Lambda Cookbook

  • Develop code that uses Java SE 8 collection improvements, including Collection.removeIf(), List.replaceAll(), Map.computeIfAbsent(), and Map.computeIfPresent() methods
  • Develop code that uses Java SE 8 I/O improvements, including Files.find(), Files.walk(), and lines() methods
  • Use flatMap() methods in the Stream API
  • Develop code that creates a stream by using the Arrays.stream() and IntStream.range() methods

Method Enhancements

  • Add static methods to interfaces
  • Define and use a default method of an interface and describe the inheritance rules for the default method

Use Java SE 8 Date/Time API

  • Create and manage date- and time-based events, including a combination of date and time in a single object, by using LocalDate, LocalTime, LocalDateTime, Instant, Period, and Duration
  • Work with dates and times across time zones and manage changes resulting from daylight savings, including Format date and times values
  • Define, create, and manage date- and time-based events using Instant, Period, Duration, and TemporalUnit


0 comments
Leave your comment: