Java 8 introduces a number of revolutionary capabilities – many of them centered on lambda expressions and functional-style programming. These capabilities add powerful new programming techniques to the language, but also add complexity.
This concise course is focused on introducing the new capabilities and how to use them. It includes numerous code examples and programming labs that illustrate all of the new capabilities.
The course is hands on, and requires that students be comfortable with writing general Java code at an intermediate level, including the use of interfaces.
All labs are done within the Eclipse IDE, and the lab instructions include detailed directions on using it.
Duration: 2 day
Hands-on: Minimum 50% hands-on
Supported Platforms: Allow 3-4 weeks for delivery. Eclipse IDE, Java 8, other IDEs upon request
Skills Gained:
- Be familiar with the additions to Java interfaces
- Understand and use functional interfaces
- Understand lambda expressions and method references, and use them to pass behavior (methods)
- Learn about the pre-defined functional interfaces, and use them with lambda expressions
- Understand and use the Stream API
- Process collections using streams
- Understand and use parallel streams
- Learn and use the new Data/Time API
- Be familiar with other new capabilities
Course Features
- Lecture 0
- Quiz 0
- Duration 2 Days
- Skill level All levels
- Language English
- Students 0
- Assessments Yes
Session 1: What’s new in Interfaces
- Static Methods
- Default Methods
- Functional Interfaces
Session 2: Introducing Lambda Expressions
- Inner and Anonymous Classes – Uses and Shortcomings
- Lambda Expression Overview
- Lambda Expressions and Functional Interfaces
- Using Lambda Expressions
- Working with Method References
Session 3: The Stream API
- What are Streams?
- Streams and Collections
- Filtering Collections
- Chaining and Pipelining
- Processing Techniques
- Extracting Data
- Searching for Data
- Sorting
- Performing Calculations
Session 4: The Built in Lambda Types
- Functional Interfaces in java.util.function
- Using Predicate
- Using Consumer and Supplier
- Using other Lambdas
Session 5: Parallel Processing / Concurrency
- Overview
- Requirements
- Executing Stream Pipeline in Parallel
- Concurrency with Lambdas
- Issues
- Performance
Session 6: Date/Time API
- Overview and Limitations of Previous API
- The Date/Time API (JSR 310)
- Date-Based and Time-Based Events
- Timestamps, Periods, and Durations
- Performing Calculations
- Formatting
- Localization / Time Zones
Session 7: Other Capabilities
- Using Optional Instead of null
- Nashorn JavaScript Engine
Minor New Features