0%

Book Description

Java SE 8 is perhaps the largest change to Java in its history, led by its flagship feature—lambda expressions. If you’re an experienced developer looking to adopt Java 8 at work, this short guide will walk you through all of the major changes before taking a deep dive into lambda expressions and Java 8’s other big feature: the Streams API.

Author Raoul-Gabriel Urma explains how improved code readability and support for multicore processors were the prime movers behind Java 8 features. He’ll quickly get you up to speed on new classes including CompleteableFuture and Optional, along with enhanced interfaces and the new Date and Time API. You’ll also:

  • Understand why lambda expressions are considered a kind of anonymous function
  • Learn how lambda expressions and the behavior parameterization pattern let you write flexible and concise code
  • Discover various operations and data processing patterns possible when using the Streams API
  • Use Collector recipes to write queries that are more sophisticated
  • Consider factors such as data size and the number of cores available when using streams in parallel
  • Work with a practical refactoring example to bring lambda expressions and streams into focus

Table of Contents

  1. 1. Java 8: Why Should You Care?
    1. Code Readability
    2. Multicore
    3. A Quick Tour of Java 8 Features
      1. Lambda Expressions
      2. Method References
      3. Streams
      4. Enhanced Interfaces
      5. New Date and Time API
      6. CompletableFuture
      7. Optional
  2. 2. Adopting Lambda Expressions
    1. Why Lambda Expressions?
    2. Lambda Expressions Defined
    3. Lambda Expression Syntax
    4. Where to Use Lambda Expressions
    5. Method References
    6. Putting It All Together
    7. Testing with Lambda Expressions
    8. Summary
  3. 3. Adopting Streams
    1. The Need for Streams
    2. What Is a Stream?
    3. Stream Operations
    4. Filtering
    5. Matching
    6. Finding
    7. Mapping
    8. Reducing
    9. Collectors
    10. Putting It All Together
    11. Parallel Streams
    12. Summary
18.223.206.69