This 3rd edition of Java Examples in a Nutshell contains 193 complete practical examples: over 21,900 lines of densely commented, professionally written Java code covering 20 distinct Java APIs, including Servlets, JSP, XML, Swing, Java2D, New I/O and Java Sound.

Buy The Book

The examples are most useful with the explanation and context provided by the book. If you do not already have a copy, please consider buying one:

Download the Examples

The complete source code for all 193 examples is available in two formats:

The third edition of the book contains modified versions of most, but not all, of the examples from the first and second editions of the book. If you want the original versions of the first or second edition examples, you can download those separately:

Commercial Use

As explained in the license, The examples are free for non-commercial use. If you want to use them commercially, however, you must purchase a license for them. This page explains how to do that.

No Warranty

Before purchasing a commercial-use license, you must understand that the programs in Java Examples in a Nutshell were written as examples, and were never intended as production-quality software. They have not been carefully tested, nor used in a production environment. If you find the programs useful nevertheless, and want to use them in your software, please understand that they come with absolutely NO WARRANTY of any kind. Neither David Flanagan nor O'Reilly & Associates are responsible for any loss or damages of any kind resulting from the use of these programs.

Price

A commercial-use license for the examples costs US$50 for each programmer who will be using them. You may also purchase a site-license for any number of programmers within an organization for US$500.

Electronic Payment

To purchase a license or site license online, select the desired number of users and click on the "Buy Now" button below. This will take you to the PayPal Web site, which supports secure credit-card transactions. Follow the instructions at the PayPal site to complete the purchase. After the purchase, you will receive e-mail from PayPal confirming your purchase. You can print out the web page or the e-mail for use as a receipt. Additionally, within several days of your purchase, you will also receive e-mail from me, confirming that you are now a license holder.
Number of users