Register your product to gain access to bonus material or receive a coupon.
1053D-6
If you are looking for a readable, up-to-date overview of the JDK and its libraries, Just Java 2, Fourth Edition is the book for you! You'll find an engaging tutorial complete with clear explanations and challenging examples, and just the right mix of comic relief. Peter van der Linden, the author of the classic Expert C Programming, brings style, personality, and wit to the challenge of simplifying Java and object-oriented programming for any programmer making the transition to the Java environment.
Because Just Java 2 assumes some programming knowledge, you won't get bogged down with the basics. A unique balance of practical advice and expert insights, this comprehensive guide to Java programming covers all the essentials including:
This revised and expanded edition includes a concise introduction to the new features and libraries, especially inner classes and the graphical "Swing" components and highlights both the advantages and challenges of programming with Java 2.
The accompanying CD-ROM is a truly awesome resource! It contains extensive sample code from top Java programmers, the complete Java Programmer's FAQ, and tons of great freeware, including Linux, Perl, GNU C/C++, Tcl, Python, Java games (with source code, and more)! Due to an unfortunate error in the manufacturing process of the CD-ROM, a number of defective or cracked CDs were shipped with this book. Prentice Hall PTR will be happy to send you a replacement CD-ROM, which can be obtained by emailing disc_exchange@prenhall.com
1. What Is Java.
Compiling and Executing a Sample Program. The Biggest Java Benefit: Portability. The “Java Platform” . The Java Language. Java Libraries. Releases of the JDK to Date. Java Virtual Machine. The World Wide Web and Java.
2. The Story of O: Object-Oriented Programming.
Abstraction. Encapsulation. The One-Minute Object Manager. Classes. Per-Instance and Per-Class Members. The “final” Modifier. Access Modifiers. Some Light Relief.
3. Explanation of a Sample Program.
Explanation of the Example Program. Where an Application Starts. Runtime Internals: Stack and Heap. The Class “Object” . Some Light Relief.
4. Identifiers, Keywords, and Types.
Identifiers. Comments. Keywords. The Primitive Types. Some Light Relief.
5. Names, Arrays, Operators, and Accuracy.
Names. Expressions. Arrays. Operators. Associativity. How Accurate Are Calculations? What Happens on Overflow? The Math Package. Some Light Relief. Further Reading.
6. More OOP —Extending Classes.
Inheritance. Polymorphism. The Class Whose Name Is Class. Some Light Relief. Exercises.
7. Java Statements.
“Organizing” Statements. Expression Statements. Selection Statements. Iteration Statements. Transfer of Control Statements. Exceptions. Some Light Relief.
8. Interfaces.
Using Interfaces Dynamically. Some Light Relief. Exercises.
9. Packages and Visibility.
How Packages Support Namespaces. Compilation Units. Inner Classes. The Class Character. Some Light Relief.
10. Doing Several Things at Once: Threads.
What Are Threads? Two Ways to Obtain a New Thread. The Lifecycle of a Thread. Thread Groups. Four Kinds of Threads Programming. Some Light Relief.
11. Advanced Thread Topics.
Swing Threads—A Caution! Garbage Collection. Some Light Relief. Exercises. Further Reading.
12. Practical Examples Explained.
Case Study Java Program: Fritter Engine Shunt. Some Light Relief. Exercises.
13. All About Applets.
Embedding a Java Program in a Web Page. Starting Applet Execution. Zip Files and Jar Files. Some Light Relief. Further References. HTML Applet Tags. Exercises.
14. JDK 1.2 Security.
The Sandbox. Code Signing. The Security Manager. Applying the Security Policy. Signing a Java Program. Some Light Relief. Further References.
15. Java Data Structures Library.
The java.math API. The java.util API. Collections. Calendar Utilities. Other Utilities. Some Light Relief. Exercises.
16. Java Enterprise Libraries.
Object Communication Middleware. Remote Method Invocation. Object Serialization. Java and Databases: JDBC. Useful URLs. Some Light Relief.
17. GUI Basics and Event-Handling.
All About Event-Handling. Tips for Slimming down Handler Code. Summary of Event-Handling. Some Light Relief.
18. JFC and the Swing Package.
Java Foundation Classes. All About Controls (JComponents). More about Swing Components. Some Light Relief.
19. Containers, Layouts, and AWT Loose Ends.
Pluggable Look and Feel. All About Containers. Layout in a Container. Tying up the Loose Ends. Some Light Relief.
20. Graphics Programming.
Colors. Fonts and Font Metrics. The Graphics Context. Drawing Text, Lines, and Shapes. Loading and Drawing Images. Sounds. Some Light Relief.
21. File I/O.
Files and Streams. Formats, Encodings, and I/O. JDK 1.1 Input. JDK 1.1 Output. Piped I/O for Threads. How to Execute a Program from Java. ZIP Files and Streams. Some Light Relief. Answer To Programming Challenge. Answer To Programming Challenge.
22. Networking in Java.
Everything You Need To Know about TCP/IP But Failed to Learn in Kindergarten. Ping in Java. Sending E-Mail by Java. How to Make an Applet Write a File on the Server. HTTP and Web Browsing: Retrieving HTTP Pages. A Client/Server Socket Program. A Multi-Threaded Client/Server System. Page Counters in Web Pages. Some Light Relief. Exercises. Further Reading. Acknowledgments.
Appendix A: The Obsolete JDK 1.0 Event Model.
Obtaining Mouse and Keyboard Input. Capturing Individual KeyPresses. Handling the Quit Event.
Appendix B: Obsolete Components of the Abstract Window Toolkit.
How the Java Abstract Window Toolkit Works. Controls, Containers, Events. All About AWT Controls (Components). All About Containers.
Appendix C: Powers of 2 and ISO 8859.
Index.
Welcome to the Just Java CD-ROM--a disk packed with all the Java tools and source code discussed in the book and lots more.
This CD is for any system that can read an ISO 9660 CD with the Rockridge/Joliet extensions (i.e., a system that can handle CDs with deep directories, symbolic links, and more than just 8.3 filenames, on Unix, Windows, and the Macintosh).
There is a huge amount of useful, entertaining, or educational material on this CD. Some of the content (and there is a lot more) is:
You can explore the CD-ROM quite effectively using a browser. Mount the CD on your computer, and point your browser at the index.html file in the root.
You'll see a display like that shown above. Notice the three frames.
You can drag the frame boundaries around if it helps you to read the contents. If you click on, for example, the "goodies" directory name indicated by the arrow in the previous diagram, the browser will take you to that directory, and the display will now look like this:
You can carry on exploring this way. You can also use the "back" and "forward" buttons in the browser if you want. There are hundreds of megabytes of data of interest to a professional programmer on this CD, including many freeware or shareware compilers for other programming languages.
Before you tackle the other languages, you'll want to install and try Java as explained in the following pages. Choose the latest (highest version number) JDK for your system, and check for a more recent one on the web.
Your CD drive letter may be d: or e: or something else. You need around 65MB of disk space for the release.
This will ask you a couple of questions and install the Java compiler and tools. A good place to install the compiler is in c:\jdk1.2.
SET PATH=c:\jdk1.2\bin; (...the rest of your path)
This CD-ROM does not have a Java compiler for Windows 3.1. A Windows 3.1 version of Java can be downloaded from http://www.alphaworks.ibm.com/formula, but I don't recommend it. Win3.1 and typical Win3.1 hardware lack too many features to be truly satisfactory.
Note: Many of the files on this CD use long file names, which is one of the features of Windows 95. If you are unable to see the long file names on the CD, your Windows 95/NT system may not be configured correctly. Check by double-clicking on the "System" icon in the Control Panel and then clicking on the "Performance" tab. If the "Performance" section does not indicate that "Your system is configured for optimal performance," then there is a configuration issue. See Windows Help or contact Microsoft Technical Support for further assistance.
Apple's Java, bundled with Mac OS 8.1 and later, only has the runtime library, not the compiler. So you'll need to install it from this CD. Apple (one of the companies with the most to gain from portable software) is regrettably not current with the latest Java. So the JDK 1.2 libraries described in this text won't yet run on your Macintosh. If you'd like to see an up-to-date version of Java on Apple's computers, be sure to let Apple know about it by letter, phone call, or e-mail.
Mac OS 8.0 or later; Mac OS 7.6.1 or later with custom install | ||
http://www.apple.com/macos/java/
Choose the highest version number release from the CD and the Apple site. Download the self-mounting image to your hard drive and double-click to open. You need around 30MB of disk space for the release.
Note: You should note that Macintosh, Windows, and Unix text files have different conventions for end-of-line. Macintosh expects a carriage return, Windows expects a carriage return and a linefeed, and UNIX expects a newline character (linefeed). Even though some text files may not appear to be properly formatted, the Java compiler handles source files created under any of these conventions.
You should also note that file names longer than twenty-six characters will be truncated on a Mac. Therefore, some of the sample Java programs on this CD will have to be renamed and recompiled to execute properly on a Macintosh.
This CD uses the Rockridge extensions, so Solaris users may get a warning message saying the CD doesn't conform to the ISO 9660 specification. Ignore it.
The solaris.sparc directory contains the JDK for Sparc. The solaris.x86 directory contains the Intel version. Installation instructions are the same for Solaris for SPARC and Solaris for x86. On Intel systems, use "x86" instead of "sparc" in the filenames below. Insert the Just Java CD into your CD-ROM drive.
# mount -rF hsfs /dev/dsk/c0t6d0s0 /cdrom/just_java
cd /cdrom/just_java/solaris.sparc
cp jdk1.2-solaris2-sparc.bin /home/linden
This is about a 20MB file, so it will take a few seconds to copy.
This will ask a couple of questions and install the Java compiler/tools.
setenv JAVAHOME /home/linden/jdk1.2
set path=( $JAVAHOME/bin ... rest of path ... )
Log out then log in so the new variables take effect.
Earlier versions of the JDK required you to set an additional variable, CLASSPATH. From JDK 1.2 this is needed only if you are trying to run user classes outside your current directory. For now, ignore this shell variable.