O'Reilly logo

Java Pocket Guide, 4th Edition by Robert Liguori, Patricia Liguori

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required


Designed to be your companion, this Pocket Guide provides a quick reference to the standard features of the Java programming language and its platform.

This Pocket Guide provides you with the information you will need while developing or debugging your Java programs, including helpful programming examples, tables, figures, and lists.

Java coverage in this book is representative through Java SE 9 incorporating a subset of the 80+ JDK Enhancement Proposals (JEPs) slated for the release. This Java coverage includes improvements to the generage language as well as coverage of the new Java Shell and the new Java Module System. This book supercedes the three previous versions: Java Pocket Guide, Java 7 Pocket Guide, and Java 8 Pocket Guide.

For uniformity and enhanced interest, the majority of the code examples in this fourth edition of the Java Pocket Guide have been updated from code segments of the Gliesians Web Application. At the time of this writing, the primary focus of the Gliesians Web Application is to provide free utilities relative to genealogy and small unmanned aerial systems.

The material in this book also provides support in preparing for the Oracle Certified Programmer exams. If you are considering pursuing one of the Java certifications, you may also wish to acquire the OCA Java SE 8 Programmer I Study Guide (Exam 1Z0-808) by Edward Finegan and Robert Liguori (McGraw-Hill Osborne Media, 2015).

Book Structure

This book is broken into three parts: Part I details the Java programming language as derived from the Java Language Specification (JLS) and JEPs. Part II details Java platform components and related topics. Part III is the appendixes covering supporting technologies.

Conventions Used in This Book

The following typographical conventions are used in this book:


Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.


This element signifies a tip, suggestion, or general note.


This element indicates a warning or caution.

O’Reilly Safari


Safari (formerly Safari Books Online) is a membership-based training and reference platform for enterprise, government, educators, and individuals.

Members have access to thousands of books, training videos, Learning Paths, interactive tutorials, and curated playlists from over 250 publishers, including O’Reilly Media, Harvard Business Review, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Adobe, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, and Course Technology, among others.

For more information, please visit http://oreilly.com/safari.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

  • O’Reilly Media, Inc.
  • 1005 Gravenstein Highway North
  • Sebastopol, CA 95472
  • 800-998-9938 (in the United States or Canada)
  • 707-829-0515 (international or local)
  • 707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://bit.ly/java-pocket-guide-4e.

To comment or ask technical questions about this book, send email to .

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia


We extend a special thank you to all the folks at O’Reilly. Appreciation of support also goes out to Greg Grockenberger and Ryan Cuprak, who wrote for the JShell and Java Module System chapters, respectively. Ryan also performed the technical review of the book, which we appreciate.

We would also like to thank again all of those who participated with the original Java Pocket Guide, the Java 7 Pocket Guide, and the Java 8 Pocket Guide.

Additional appreciation to people not related to this book project: Don Anderson, David Chong, Keith Cianfrani, Jay Clark, Steve Cullen, Ed DiCampli, Phil Greco, Scott Houck, Cliff Johnson, Juan Keller, Fran Kelly, Mike Krauss, Mike Lazlo, Phil Maloney, Lana Manovych, Matt Mariani, Chris Martino, Roe Morande, Sohrob Mottaghi, Brendan Nugent, Keith Smaniotto, Tom Tessitore, Lacey Thompson, Tyler Travis, Justin Trulear, and Jack Wombough.

We would finally like to thank all of our family members for always being there for us.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required