877-277-2477
info@capstonecourseware.com
105. Migrating to Java 8
Version 8.0

Book cover

This course shows Java-6 developers the new language features in Java 7 and Java 8 -- and more importantly illustrates best programming practices as they've been affected by these new features. This is an accelerated course that assumes long experience with earlier versions of Java. Students will leave familiar with various new bits of syntax, and also with an understanding of the exciting new options they have for API design and general-purpose Java 8 coding.

For those developers who need to cover more ground, this version of the course can be combined with an earlier version that introduces new features in Java 5 and Java 6: see Course 105, version 6.0.

Prerequisites

  • Solid experience with Java programming at the Java-5 or Java-6 level is essential.

Learning Objectives

  • Take advantage of Java-7 features including strings in switch/case and auto-selection of type parameters for generics.
  • Use "try-with-resources" for simpler cleanup.
  • Use Java as a functional language, making appropriate choices of tools including inner classes, functional interfaces, method references, and lambda expressions.
  • Use the Stream API for efficient processing of data sets.
  • Use the Time API to manage local dates and times effectively.

Timeline: 1 day.

IDE Support: Eclipse Luna

  • In addition to the primary lab files, an optional overlay is available that adds support for Eclipse Luna. Students can perform all coding, testing and debugging tasks from within the IDE. See also our orientation to Using Capstone's Eclipse Overlays.

Module 1. New Features in Java 7

Chapter 1. New features in Java 7

  • Binary Literals
  • Integer Literals with Underscores
  • String Types in switch/case
  • Auto-Detection of Type Parameters
  • Try-with-Resources
  • Multiple Exceptions in catch

Module 2. New Features in Java 8

Chapter 1. Functional Programming

  • Passing Behavior as a Parameter
  • Inner Classes
  • Functional Interfaces
  • Built-In Functional Interfaces
  • Lambda Expressions
  • Scope and Visibility
  • Deferred Execution
  • Method References
  • Creational Methods
  • Designing for Functional Programming
  • Default Methods

Chapter 2. Streams

  • The Stream Processing Model
  • Streams
  • Relationship to Collections
  • Advantages and Disadvantages
  • Iterating, Filtering, and Mapping
  • Primitive-Type Streams
  • Aggregate Functions and Statistics
  • Sorting
  • Generating, Limiting, and Reducing
  • Finding and Matching
  • Grouping
  • Flattening and Traversing
  • Sequential vs. Parallel Processing

Chapter 3. The Time API

  • A History of Time ... in Java
  • Limitations of Date and Calendar
  • The Time API
  • Temporal Types
  • Accessors and Adjusters
  • Formatting
  • Decomposition Into Fields
  • Date Arithmetic
  • Managing Precision
  • Duration and Period
  • Time Zones and Offsets
  • Converting Between Time Zones

System Requirements

Hardware Requirements (Minimum) Core i5, 1.8 GHz, 4 gig RAM, 500 meg disk space.
Hardware Requirements (Recommended) Core i5, 2.8 GHz, 8 gig RAM, 500 meg disk space.
Operating System Tested on Windows 7/8, Mac OS 10.5.2.
Network and Security Limited privileges required -- please see our standard security requirements.
Software Requirements All free downloadable tools.