Resources

In 1997, Jim Grundy, who was running one of the first courses which used Java in our School, had said:

There is an awful lot of books about Java, and most of them are awfully bad.

The situation with quality of books to learn Java programming with has changed in twenty years: Now it is hard to choose from many good ones.

Good books about Java

Core Java Core Java for the Impatient by Cay S. Horstmann, Addison-Wesley, 2015 (or later print or edition), ISBN-13: 978-0-321-99632-9, 512p.This is our “official” textbook. Concise (≤ 500 pages, which is not easy for Java presentation), accurate and quite clear exposition of (almost) everything you need to know for this course except for GUI programming and JavaFX, and some functional programming techniques. What you get:
  • A rapid introduction to the good parts of Java for competent programmers
  • A thorough introduction into lambdas and the stream library
  • A modern coverage of concurrent programming that focuses on high-level synchronisation constructs
  • Blog-length chunks of information that you can digest quickly
  • An organisation that you’ll find useful as a quick reference

You can order the book through ANU’s Coop Bookshop, but a cheaper option would be to use the Book Depository on-line store (it requires a credit card or a PayPal account), which costs less than AUD$50 (with free delivery), and can be delivered in a few days. Other (electronic) formats are also available, check the author Cay Hortsmann website.

Alternative if you already have a good book on “old” Java

Java SE 8 Java SE 8 for the Really Impatient by Cay S. Horstmann, Addison-Wesley, 2014, ISBN-13: 978-0-321-92776-7, 216 pages. In case if you’ve got (as inheritance or by another chance) a good Java programming book which is a bit old and does not cover the Java SE 8 additions, there is a lighter version of C. Hortsmann’s textbook which can be used as a supplement to your library. It also has a chapter on GUI programming with JavaFX, so it is a good deal. It contains:
  • A rapid introduction to the new Java 8 features for competent Java programmers
  • A concise but thorough introduction into lambdas and the stream library
  • Complete coverage of other new features in the biggest release since Java 1.0
  • Blog-length chunks of information that you can digest quickly
  • An organisation that you’ll find useful as a quick reference

However, the book provides neither a proper introduction to the language basics (use your other texts), nor argues about superiority of the functional paradigm over the others, nor dives deep into traps, pitfalls and gotchas (sorry for using this word) of programming practices involving the λ-expression and streams. We follow this book in some parts of Functional Programming in Java lectures. A good (if not the best with the current exchange rate) deal is probably the BookDepository on-line store.

From the hands of Java’s creators

The Java PL From the people who created Java: The JavaTM Programming Language, 4th Edition by Ken Arnold, James Gosling (the language creator) and David Holmes, Addison Wesley, 2005, ISBN: 0-321-34980-6, 928 pages. (from the cover quote) “…is the definitive tutorial introduction to the Java language and essential libraries and an indispensable reference for all programmers, including those with extensive experience.”

Some of our discussions and examples have been borrowed from this book. Mind you, however, that this edition covers Java SE 5, and it has not been updated since (it does not include the most important language extension which has come in the Java SE 8 — lambdas and all that). The style of this book is not one of a textbook exposition, but it is highly valuable to medium to high level programmers. As is the following masterpiece:

One of the most useful books

Effective Java Effective Java: Programming Language Guide, 2nd Ed. by Joshua Bloch, Addison Wesley, 2008, ISBN-13: 0-321-35668-0, 346 pages. “…concise book packed with insight and wisdom, not found elsewhere.” The winner (1st edition) of the Jolt Award, this book consists of 78 episodes devoted to most effective solutions of everyday problems. Written by a supremely qualified developer who was responsible for Java’s enum and generics.

It would be delightful if Dr. Bloch had prepared a new edition to include λ-s and streams (the core features of Java SE 8).

Modern Java Books about lambdas and streams

Java 8 in Action Java 8 in Action by Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft, Manning, 2015, ISBN: 978-1-172-919-99, 394p. The work on extending Java’s syntax to include closures, or what they are now officially referred to, λ-expressions, has been quite long. Since the process was public, when the Java 8 release happened (in March 2014), there was already several books available. The text by Urma et al is most thorough and detailed. It contains:
  • How to use Java 8’s powerful new features
  • Writing effective multicore-ready applications
  • Refactoring, testing, and debugging
  • Adopting functional-style programming
Mastering Lambdas Mastering Lambdas: Java Programming in a Multicore World by Maurice Naftalin, Oracle Press, 2014, ISBN: 978-0-071-829-625. The book describes how the lambda-related features of Java SE 8 will enable Java to meet the challenges of next-generation parallel hardware architectures, and to take full advantage of performance improvements provided by today’s multicore hardware. It contains:
  • Why lambdas were needed, and how they will change Java programming
  • Syntax of lambda expressions
  • The basic operation of streams and pipelines
  • Using collectors and reduction to end pipelines
  • Creating streams
  • Spliterators, the fork/join framework, and exceptions
  • Examining stream performance with microbenchmarking
  • API evolution using default methods

The author maintains the web site Maurice Naftalin’s Lambda FAQ, which probably has the most lucid explanation of the Java 8 language extensions (apart from his book). He has also given master classes at different Java conferences world wide in recent years – look up on Youtube and elsewhere.

FP in Java Functional Programming in Java. How functional techniques improve your Java programs by Pierre-Yves Saumont, Manning, 2017, ISBN 978-1-617-292-736. Functional Programming in Java teaches Java developers how to incorporate the most powerful benefits of functional programming into new and existing Java code. You’ll learn to think functionally about coding tasks in Java and use FP to make your applications easier to understand, optimize, maintain, and scale. It contains:
  • Writing code that’s easier to read and reason about
  • Safer concurrent and parallel programming
  • Handling errors without exceptions
  • Java 8 features like lambdas, method references, and functional interfaces

The content of this book is highly original, and many explained techniques will be revelation for the reader, some may have a universal value and have a much wider applicability than merely in Java.

Web sites

Java-Cup You can learn the language very well – its features and effective usage, so you do not have to constantly refer to a book how to deal with your current coding problem. But you do need to use the language libraries, which have been designed and implemented for you by professionals. These resources are known as API: Application Programming Interface. In Java, they represent a huge collection of classes and interfaces, organised into packages.

The Java API Documentation can be downloaded and used locally. You should make a bookmark link to it on your web browser to have it always at hand.

Duke Official JavaTM Tutorials by Oracle. This is an excellent source of knowledge on how to use the Java platform, including its language features, platform components and tools. You can download an archived version (about 50 Mb), and install it on your desktop or laptop computer. Some of our presentations will borrow from these tutorials. The Java tutorial, in its fulness, can replace any book, and save you money.

Note, that the part of the Tutorial which regards the GUI Programming with Swing API should be ignored, and JavaFX programming looked into instead (Swing is an older GUI API which is no longer developed).


The next three online training resources are pinched from Steve Blackburn’s COMP1110 course (hence, all annotations on the right are direct citations of Steve):

CodeHunt Microsoft’s training online tool which is a great way to learn about Java. Use the Java language mode and then start playing. It’s fun and addictive. [It also helps to train concentration which is indispensable faculty for succeeding on exams!]
Intro Progr in Java There’s a nice cheatsheet contained in an appendix to Robert Sedgewick and Kevin Wayne’s Introduction to Programming in Java. [And once you’re onto it, perhaps, you can check the textbook itself as a supplementary or an alternative text to those suggested above.]
Java Visualizer Waterloo University has made available a wonderful tool Java Visualizer for understanding the basics of Java. This tool allows you to paste in basic Java programs and watch them execute step-by-step. It illustrates the underlying data structures and allows you to step backwards and forwards in time. I highly recommend that you use this tool to help you understand what is going on when a Java program executes.

Of a similar kind to the last above, but this time is a canonical tool, a soon will be a part of the Java Standard Toolkit, the Java shell:

JDK9 REPL Read-Evaluate-Print-Loop is a shell which you can use to experiment with small chunks of Java code before including them into your program. You need JavaSE 9 (currently available as a pre-release version), and run jshell on the command line. We demonstrate its use in the lectures.

Integrated Development Environments (IDEs)

There are three widely used IDE’s for programming in Java and related technologies, and they are all installed on our lab computers:

Our preferences without a question go to

IntelliJ Idea IntelliJ IDEA from the company JetBrains. It is 16+ years old (probably older then Eclipse and Netbeans). It provides support to the developer of such power and insight, that its rivals can be envious. “Develop with pleasure!” is the motto. One often gets a feeling that IDEA knows about the code you are writing more than you do. Code assistance, refactoring and keyboard-centric approach (no need to use the mouse!) are unmatched.

Since 2010 the company provides the Community Edition, a free version with a smaller set of functionalities (which are quite sufficient for a beginner and/or an amateur programmer). The licence for the full version is very affordable and represents an excellent value for money.

Git

Git is the most widely-used version control system and an integral part of this course. The Git website has documentation and videos on getting started with Git.

The Code School Try Git tutorial allows you to try out Git repositories and commands in a friendly ‘sandbox’ environment.

Updated:  30 May 2017/ Responsible Officer:  Head of School/ Page Contact:  Alexei Khorev