OCPJP 8 Upgrade from Java 7 Topics
Lambda Expressions
- Describe and develop code that uses Java inner classes, including nested class, static class, local class, and anonymous classes
- Articles: Inner Class
- Quizzes: Inner Class Quiz
- Describe and write functional interfaces
- Articles: Functional Interface
- Quizzes: Functional Interface Quiz
- Describe a lambda expression; refactor the code that uses an anonymous inner class to use a lambda expression; describe type inference and target typing
- Articles: Lambda Expression
- Quizzes: Lambda Expression Quiz
Using Built-in Lambda Types
- Describe the interfaces of the java.util.function package
- Articles: java.util.function Package
- Quizzes: java.util.function Package Quiz
- Develop code that uses the Function interface
- Articles: Function Interface
- Quizzes: Function Interface Quiz
- Develop code that uses the Consumer interface
- Articles: Consumer Interface
- Quizzes: Consumer Interface Quiz
- Develop code that uses the Supplier interface
- Articles: Supplier Interface
- Quizzes: Supplier Interface Quiz
- Develop code that uses the UnaryOperator interface
- Articles: UnaryOperator Interface
- Quizzes: UnaryOperator Interface Quiz
- Develop code that uses the Predicate interface
- Articles: Predicate Interface
- Quizzes: Predicate Interface Quiz
- Develop code that uses the primitive and binary variations of the base interfaces of the java.util.function package
- Articles: java.util.function Package
- Quizzes: java.util.function Package Quiz
- Develop code that uses a method reference, including refactoring a lambda expression to a method reference
- Articles: Method References
- Quizzes: Method References Quiz
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