Java 9 for Programmers

This book is the first of the comprehensive language tutorials to come to market that includes extensive coverage of Java 9. In this context, it competes with other 1,000-page volumes that present the entire language and its principal APIs. For example, it competes with Cay Horstmann’s excellent Core Java, which I’ve reviewed previously in this column. Both entrants are fine works, and choosing one or the other depends in large part on your personal preferences. (Note: Core Java has not been released for Java 9, although an abridged version is available.)

The Deitels’ book is notable for its hands-on orientation: it is code-intensive with numerous examples. It even includes a full project (comprising 77 pages) that goes from initial design of an ATM machine all the way through to completion. The design portion includes introduction to the basic Unified Modeling Language (UML) diagrams, putting together the object-oriented design, and incrementally developing the code. Working through this project is an excellent education quite apart from the use of Java.

Java 9’s most important features receive rich coverage. For example, the section on modules is a full 52 pages that explore the need for modules, how modules work, and how to use them in your own code. To get a sense of the hands-on nature of the explanations, see the lightly edited excerpt from this section that ran in this magazine. It was one of our most popular articles in 2017.

This is the first book I’ve seen on Java 9 that has in-depth coverage of JShell, the new REPL introduced in Java 9. Its pedagogical benefits are not lost on the authors, who drill into how to make best use of it both as a programming aid and as a teaching tool.

In addition to the language proper, the book covers JavaFX, JDBC, and JPA. Each chapter includes self-review exercises, with accompanying solutions; the explanations are sprinkled with caveats for dangers, reminders about good programming practices, and tips on writing idiomatic Java. In other words, this is a complete presentation.

I have only one gripe with this volume, and that is the excessive use of color highlighting in the code. Even if you’re a fan of brightly colored code, your eyes will quickly tire of reading pale blue text or squinting at bright green comments on a canary-yellow background. But if you can handle that, you’ll have a very fine book that does an excellent job of presenting Java 9.