Skip to Content
Modern Java Recipes
book

Modern Java Recipes

by Ken Kousen
August 2017
Intermediate to advanced
319 pages
6h 50m
English
O'Reilly Media, Inc.
Book available
Content preview from Modern Java Recipes

Chapter 10. Java 9 Additions

At the time of this writing, Java SDK 9 is considered feature complete, but not yet released. The new feature garnering the most press coverage is Project Jigsaw, which introduces a new modularization mechanism into the language.

This chapter contains recipes involving the new additions, like private methods in interfaces, factory methods for immutable collections, and the new methods for streams, Optional, and Collectors. Each of the recipes has been tested with Java SE 9 Early Access build 174.

FYI, the new features in Java 9 not covered in this chapter are:

  • The jshell interactive console

  • The modified try-with-resources block

  • The relaxed syntax for the diamond operator

  • The new deprecation warnings

  • The reactive streams classes

  • The stack-walking API

  • The revised Process class

Several are relatively minor (like the diamond operator changes, try-with-resources requirements, and deprecation warnings). Some are specialty topics (like the stack-walking API and the changes to the Process API). The new shell is covered heavily in the documentation, along with a tutorial.

Finally, the reactive streams additions are fascinating, but the open source community already provides APIs like Reactive Streams, RxJava, and more, and it might be a good idea to wait to see how the community decides to support the new Java 9 API.

The recipes in this chapter hopefully cover the most common use cases. Should that turn out not to be the case, more recipes will ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Java in Action video edition

Modern Java in Action video edition

Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft
Modern Java in Action

Modern Java in Action

Raoul-Gabriel Urma, Mario Fusco, Alan Mycroft
Java 8 in Action

Java 8 in Action

Mario Fusco, Alan Mycroft, Raoul-Gabriel Urma

Publisher Resources

ISBN: 9781491973165Errata Page