Conventions Used in This Book

This book uses the following conventions.

Programming Conventions

I use the following terminology in this book. A program means either an applet, a servlet, or an application. An applet is for use in a browser. A servlet is similar to an applet but for use in a server. An application is any other type of program. A desktop application (a.k.a. client) interacts with the user. A server program deals with a client indirectly, usually via a network connection.

The examples shown are in two varieties. Those that begin with zero or more import statements, a Javadoc comment, and a public class statement are complete examples. Those that begin with a declaration or executable statement, of course, are excerpts. However, the full versions of these excerpts have been compiled and run, and the online source includes the full versions.

Recipes are numbered by chapter and number, so, for example, Recipe 7.5 refers to the fifth recipe in Chapter 7.

Typesetting Conventions

The following typographic conventions are used in this book:


is used for commands, filenames, and sample URLs. It is also used to define new terms when they first appear in the text.

Constant width

is used in code examples to show partial or complete Java source code program listings. It is also used for class names, method names, variable names, and other fragments of Java code.

Many programs are accompanied by an example showing them in action, run from the command line. These will usually show a prompt ending in either $ for Unix or > for Microsoft, depending on which computer I was using that day. Text before this prompt character can be ignored; it will be a pathname or a hostname, again depending on the system.

Get Java Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.