Transitioning to Java 8

COURSE OUTLINE:

Description

This course is geared for developers who have prior working knowledge of earlier versions of Java. Throughout the course, you will learn the best practices for taking advantage of the new functional programming constructs in Java as well as other new features in this major update to the Java programming language.

Audience

Experienced Java developers who wish to learn Java 8

Prerequisites

Attendees should have a working knowledge of developing Java applications

Learning Objectives

  • What functional programming means and what it provides
  • How Lambda expressions and functional interfaces can greatly enhance other aspects of Java
  • To use the new stream constructs to work with collections and collectors
  • How to work with default methods and pass methods as arguments
  • How to use the new features to support concurrency in multi-code systems
  • To work with the new date/time application programming interface (API) and other new features
  • Work with the JavaScript engine Nashorn

Specific Java 8 features that are covered in the course include:

  • Functional programming
  • Anonymous functions
  • Lambda expressions and default methods
  • Streams and collectors
  • New date/time API
  • StringJoiner and repeating annotations

1. Introduction to Lambda Expressions

  • Introduction to Java 8
    • Overview of Java 8 Features and Enhancements
    • Anonymous Functions, Streams
    • Interfaces in Java 8
      • Default Methods
      • Static Methods
      • Multiple Inheritance
  • Functional Programming
    • Functional vs. OO Programming
    • Anonymous Inner-Classes
    • Utility Methods
    • Lambda Expressions
  • Lambda Expressions and Functional Interfaces
    • Lambda Expression Syntax
    • Functional Interfaces
    • Type Inference in Java 8

2. Streams and Lambda Expressions

  • Streams
    • The Stream Interface
    • Reduction and Parallelism
    • Collections and Collectors
      • Filtering Collection Data
      • Sorting Collection Data
  • Using Lambda Expressions
    • Using Method References in Lambda Expressions
    • Optional vs. Null

3. Additional Java 8 Enhancements

  • New Java 8 features
    • The New Date/Time API
    • LocalDate, LocalDateTime
    • Formatting Dates
    • StringJoiner
    • Static Methods on Interfaces
    • Repeating and Type Annotations
    • Parallel Array Sorting
    • Improved Type Inference
    • Method Parameter Reflection
    • Updated Command Line Tooling
  • Java 8 Concurrency updates
    • Parallel Data Processing
    • Working with Streams in Multi-Core Architectures
    • Using Lambda Expressions with Concurrency
  • Nashorn JavaScript Engine
    • Working with JavaScript and Java
    • Accessing Nashorn
    • Executing JavaScript from Java
    • Executing JavaScript from Java
    • Implementing a Java Interface
    • Alternatives to Nashorn