Java 8 Masterclass

Java 8 isn't your parent’s Java anymore. It is the largest update to Java in its history. It's a very exciting time. Some of the best ideas from functional programming are migrating their way into Java 8. This means easier to read, more flexible code that scales to multicore.

At the end of this course, you will be ready to use Java 8 on your day job and be familiar with the cutting edge programming approaches which allow you to write more flexible and concise code.

Each participant will receive a copy of “Java 8 in Action: Lambdas, Streams, and functional-style programming" by Raoul-Gabriel Urma or "Java 8 Lambdas: Pragmatic Functional Programming" by Richard Warburton.

Course content

Day 1

  • Lambda Expressions
    • Why Java 8?
    • Behavior Parameterization
    • What is a lambda
    • Functional interfaces: where to use lambda expressions?
    • Method references: first-class functions in Java 8
    • Advanced details
  • Streams
    • Collection Processing
    • Stream operations and patterns
    • Stream Optimization
  • Collectors
    • Grouping and partitioning
    • Collection Operations
    • Arithmetic collectors
    • Advanced Queries
    • Mutable Reduction
  • Easy Data Parellelism
    • What is Data Parellelism?
    • Why is this important?
    • Parallelising your streams
    • Parallel Gotchas
    • Decomposition performance

Day 2

  • Testing & Debugging Lambda Expressions
    • Unit testing lambda expressions
    • Debugging with laziness
    • Stack traces
  • Default and static methods on interfaces
    • Motivation for default methods
    • Static methods in interface
    • Useful default methods
    • Patterns for default methods
    • Resolution rules
  • Enhanced Design with Lambdas
    • Execute around: resource handling
    • Deferred execution: Logging
    • Design patterns
  • Date & Time in Java 8
    • The problem with existing date and time libraries
    • The core classes: LocalDate/LocalTime
    • Common API Patterns
    • Timezones
  • Optional data types
    • The problem with null
    • How Optional improves upon null
    • How to use Optional in your code
  • Enhanced Concurrency with Lambdas and CompleteableFutures