Java Precisely

Cover Java Precisely, Third Edition, describes Java 8.0, including lambda expressions, method reference expressions, functional interfaces, streams, parallel streams, and parallel array operations.

It is a quick reference for the reader who has learnt (or is learning) Java from a standard textbook, and who wants to know the language in more detail.

Here's a bonus note with Java performance tips (updated April 2005).

Here's another bonus note which summarizes the results of Java floating-point operations; they are as expected for the IEEE 754-2008 standard for floating-point arithmetic. (January 2009). Here are some lecture slides that explain IEEE 754 floating-point arithmetics and the accompanying Java source code.

One more bonus note about microbenchmarks in Java with source code (updated September 2015).

See also C# Precisely.

The third edition (2016)

Java Precisely, Third Edition, MIT Press 2016, describes Java 8.0 and has 199 pages and 216 examples. See the book's page at MIT Press. Get it from

Example programs from the third edition

The second edition (2005)

Java Precisely, Second Edition, describes Java 5.0 and has 142 pages, a comprehensive index and 165 examples.

Bibliographic data

P. Sestoft, Java Precisely, Second Edition, The MIT Press August 2005. ISBN 0-262-69325-9. List price: US $18.95.

Get it from or

Example programs from the second edition

The first edition (2002)

The first edition gives a concise description of the Java programming language (Java 2 JDK 1.3 and 1.4) in 107 pages plus a comprehensive index. It includes 114 examples; see below. P. Sestoft, Java Precisely, The MIT Press June 2002. ISBN 0-262-69276-7. List price: US $16.95.
Get it from or

Some reviews of the first edition

Example programs from the first edition

Disclaimer Java Precisely and its example programs come with no warranty of any kind, either expressed or implied. In no event shall I or the Royal Veterinary and Agricultural University or the IT University of Copenhagen or The MIT Press be liable for any damage resulting from its use.

The zero'th edition: old online version (2000)

The old online version (September 2000) has no material on the collection classes, on input and output, the assert statement, and a number of other things. Also, the index and the layout are better in the printed version.

License Any individual or institution has the right to download, print and reproduce the September 2000 online version of Java Precisely, but not to modify or sell it -- except that copies may be sold to students at the cost of reproduction.

Any individual or institution may make electronic copies of the September 2000 online version of Java Precisely available locally (within an organization), but not publicly, e.g. on the Internet.


Thanks to Rasmus Lund, Niels Hallenberg, Hans Henrik LÝvengreen, Christian Gram, Jan Clausen, Anders Peter Ravn, Bruce Conrad, Brendan Humphreys, Hans Rischel and Ken Friis Larsen for their useful comments, suggestions, and corrections. Special thanks to Rasmus Lund for letting me adapt his collections diagram for this book. Warm thanks to the editors Bob Prior, Deborah Cantor-Adams, Ada Brunstein and Marie Lufkin Lee, and the extraordinarily careful copy editors, at The MIT Press.

Java Precisely was written using the following software: Linux, GNU Emacs, LaTeX 2e, xfig, xdvi, dvips, psselect, psnup, ps2pdf, Ghostview, Adobe Acrobat Reader, Netscape Navigator, Google Chrome, CVS, GNU make, GNU tar, sed, zip, Moscow ML, IBM's Jikes, IBM's JIT JVM for Linux, and Oracle's javac and jar.

This material is Copyright (c) 2000 Peter Sestoft and Copyright (c) 2002, 2005, 2016 The MIT Press.

Peter Sestoft ( 2005-07-19, 2019-02-13