#####These are preparation materials for the Oracle's "Upgrade to Java SE 8 Programmer" exam (1Z1-810).
####Exam topics:
#####1. Lambda Expressions
-
1.1. Describe Java inner classes and develop the code that uses Java inner classes (such as: nested class, static class, local class and anonymous classes): InnerClassExample.java, StaticInnerClassExample.java, AnonymousClassExample.java, LocalMethodClassExample.java
-
1.2. Define and write functional interfaces
A functional interface is an interface that specifies exactly one abstract method. The signature of the abstract method of a functional interface is called a function descriptor. @FunctionalInterface annotation is used to indicate that the interface is intended to be a functional interface.
-
1.3. Describe a Lambda expression; refactor the code that use anonymous inner class to use Lambda expression including type inference, target typing: RefactoringCodeExample.java, TypeInferenceExample.java
#####2. Using Built in Lambda Types
- 2.1. Describe the built in interfaces included in Java 8 – java.util.function package
| Functional interface | Function descriptor | Primitive specializations |
|---|---|---|
| Function<T, R> | T -> R | IntFunction, IntToDoubleFunction, IntToLongFunction, LongFunction, LongToDoubleFunction, LongToIntFunction, DoubleFunction, ToIntFunction, ToDoubleFunction, ToLongFunction |
| Consumer<T> | T -> void | IntConsumer, LongConsumer, DoubleConsumer |
| Supplier<T> | () -> T | BooleanSupplier, IntSupplier, LongSupplier, DoubleSupplier |
| UnaryOperator<T> | T -> T | IntUnaryOperator, LongUnaryOperator, DoubleUnaryOperator |
| BinaryOperator<T> | (T, T) -> T | IntBinaryOperator, LongBinaryOperator, DoubleBinaryOperator |
| Predicate<T> | T -> boolean | IntPredicate, LongPredicate, DoublePredicate |
- 2.2. Develop code that uses Function interface: FunctionInterfaceExample.java
- 2.3. Develop code that uses Consumer interface: ConsumerInterfaceExample.java
- 2.4. Develop code that uses Supplier interface: SupplierInterfaceExample.java
- 2.5. Develop code that uses UnaryOperator and BinaryOperator interfaces: UnaryAndBinaryOperatorInterfacesExample.java
- 2.6. Develop code that uses Predicate interface: PredicateInterfaceExample.java
- 2.7. Develop the code that use primitive and binary variations of base interfaces of java.util.function package: PrimitiveAndBinaryVariationsExample.java
- 2.8. Develop the code that use method reference; including refactor the code that use Lambda expression to use method references: MethodReferenceExample.java
#####3. Filtering Collections with Lambdas
- 3.1. Develop the code that iterates a collection by using forEach; including method chaining: ForEachExample.java
- 3.2. Describe the Stream interface and pipelines: StreamInterfaceExample.java
- 3.3. Filter a collection using lambda expressions: FilterCollectionExample.java
- 3.4. Identify lambda operations that are lazy
#####4. Collection Operations with Lambda
- 4.1. Develop code to extract data from an object using map: ExtractDataWithMapExample.java
- 4.2. Search for data using search methods including: findFirst, findAny, anyMatch, allMatch, noneMatch; SearchDataExample.java
- 4.3. Describe the unique characteristics of Optional, OptionalInt, OptionalLong, and OptionalDouble classes: OptionalExample.java
- 4.4. Perform calculations by using methods count, max, min, average, and sum: CalculationsExample.java
- 4.5. Sort a collection using lambda expressions: SortCollectionWithLambdas.java
- 4.6. Save results to a collection by using the collect method and Collectors class; including methods such as averagingDouble, groupingBy, joining, partitioningBy: CollectorsMethodsExample.java
#####5. Parallel Streams
- 5.1. Develop the code that use parallel streams: ParallelStreamExample.java
- 5.2. Implement decomposition and reduction in paraller streams: ReductionExample.java
#####6. Lambda Cookbook
- 6.1. Develop the code that use Java SE 8 collection improvements: Colleciton.removeIf, List.replaceAll, Map.computeIfAbsent, Map.computeIfPresent, Map.forEach: CollectionImprovmentsExample.java
- 6.2. Read files using lambda improvements in Files API including find(), lines(), and walk() methods: FilesApiImprovementsExample.java
- 6.3. Use merge and flatMap methods on a collection: MergeAndFlatMapExample.java
- 6.4. Describe other stream sources Arrays.stream() and IntStream.range(): OtherStreamSourcesExample.java
#####7. Method Enhancements
- 7.1. Adding static methods to interfaces: StaticMethodsExample.java
- 7.2. Define and use a default method of a interface and describe the inheritance rules for a default method: DefaultMethodsExample.java
#####8. Use Java SE 8 Date/Time API - 10%
- 8.1. Create and manage date-based and time-based events; including combination of date and time into a single object using LocalDate, LocalTime, LocalDateTime, Instant, Period, Duration: CreateAndManageDateTimeExample.java
- 8.2. Work with dates and times across time-zones and manage changes resulting from daylight savings: TimeZonesExample.java
- 8.3. Define and create timestamps, periods and durations; apply formatting to local and zoned dates and times: DateTimeFormattingExample.java
#####9.JavaScript on Java with Nashorn
- 9.1. Develop Javascript code that creates and uses Java members such as Java objects, methods, JavaBeans, Arrays, Collections, Interfaces: JavasriptUsesJavaExample.java, characters-list.js
- 9.2. Develop code that evaluates JavaScript in java, passes Java object to Javascript, invokes Javascript function and calls methods on Javascript objects: JavaEvaluatesJavascriptExample.java, quebec-gst-tax-calculator.js
####Other resources:
######Futurama and Futurama characters are the trademarks of Twentieth Century Fox Film Corporation.