Directions for Downloading Sample Programs

Data Structures and Other Objects Using Java (Third Edition)
by Michael Main
ISBN 0-321-37525-4

  1. Download the file by RIGHT clicking and choosing Save Target As. You may download this file to any directory, and then unzip it. For example, I unzipped mine in a folder called \JavaBook. You should find these subfolders after unzipping:
    1. applications
    2. applets
    3. docs
    4. edu

  2. Your own programs do not need to be in same folder as the samples, but when you compile (with the javac command) and run (with the java command) you must tell both commands where to find the classes that you are importing. For example, you can compile and run from Figure 2.3 with these commands (assuming that is in the current folder):

    javac -classpath .;\JavaBook
    java -classpath .;\JavaBook ThrottleDemonstration
    These commands give extra information about the classpath, telling the javac and java commands to look first in the current folder (which is represented by the period before the semi-colon) and in the folder called \JavaBook). If you are using some programming environment that does not use the javac and java commands directly, then you'll need to find out how that environment goes about setting the classpath variables.

Data Structures and Other Objects Using Java

Michael Main (