This book is dedicated to my son and favorite writer, Jason Jaworski.
I'd like to thank everyone who helped to see this book to completion. In particular, I'd like to thank Margot Maley of Waterside Productions for making the book possible, Jeff Taylor, Tim Ryan, Rebecca Mounts, and Jon Steever of Macmillan Computer Publishing for their numerous suggestions that improved the overall quality of the book, and Jeff Perkins for his excellent technical input. Finally, I'd like to thank Emily, Lisa, and Jason for their patience, love, and understanding.
Jamie Jaworski is a professional Java programmer who develops advanced systems for the United States Department of Defense. He has used Java in several research and development projects, including a terrain analysis program and a genetic algorithm demonstration. He is also the author of The Java Developer's Guide, and Mastering JavaScript.
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way.
As the Executive Editor for the Web Publishing team at Macmillan Computer Publishing, I welcome your comments. You can fax, email, or write me directly to let me know what you did or didn't like about this book--as well as what we can do to make our books stronger.
Please understand that I won't have time to help you with technical problems related to the topic of this book, and that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this book's title and author as well as your name and phone or fax number. I will carefully review your comments and share them with the author and editors who worked on the book.
Fax: 317-817-7070
E-mail: java@mcp.com
Mail: Tim Ryan, Executive Editor Java Macmillan Computer Publishing 201 West 103rd Street Indianapolis, IN 46290 USA
Never before has a new programming language received so much attention and become so popular so quickly. In the first year of its existence, Java took the Web by storm and became its adopted programming language. Since then, Java has become the language of choice for developing both Internet and intranet applications, and is used for both business and consumer software development. The Java phenomenon has captivated the imaginations of programmers around the world and is leading the way toward the next era of distributed application development.
Java's appeal lies in its simplicity, its familiarity, and the careful selection of features that it includes and excludes. Java was not designed by a government committee or a clique of academics. It shares its spirit with C more than any syntactical similarities. It is a programming language that was designed by programmers for programmers.
This book shows you how to program in Java, with the emphasis on version 1.2 of the Java Development Kit (JDK). It provides you with plenty of programming examples and arms you with the mindset needed to write Java code in a manner that is simple, efficient, and true to the nature of the language.
This book is for Java programmers. If you are not already a Java programmer, I suggest that you pick up an introductory Java book, such as Sams Teach Yourself Java 1.2 in 21 Days by Laura Lemay and Rogers Cadenhead. This book takes up where the introductory books leave off. It is an intermediate-to-advanced book that assumes you know how to use Java programming statements and that you have a basic understanding of exceptions and threads programming. If you have written programs in C or C++, you should have the background necessary to understand the material presented in this book. The syntax of Java is very similar to C and C++.
If you want to learn how to program using the JDK 1.2, this book is for you. You will learn how to program using all of the application programming interfaces (APIs) of the JDK 1.2. You'll use these APIs to develop Java applets, standalone window and console applications, beans, servlets, and distributed objects. You'll learn how to work with GUI controls, Swing components, TCP/IP sockets, remote method invocation, CORBA, multimedia, JDBC, and plenty of other new Java technologies. If you want to upgrade your Java programming skills to JDK 1.2, this book will show you how.
This book uses certain conventions that make it easier for you to use.
A monospaced font is used to identify program code. Anything that you type while using Java is displayed in a bold monospaced font. An italic monospaced font is used to identify placeholders used in Java syntax descriptions.
NOTE: Notes like this are used to call your attention to information that is important to understanding and using Java.
TIP: Tips like this are used to identify ways that you can use Java more efficiently or take advantage of undocumented features in the Java Development Kit and Java-enabled browsers.
WARNING: Warnings like this are used to help you to avoid common problems encountered when using Java, and to keep you clear of potential programming difficulties.
In order for you to understand where you are going and where you have been, each chapter begins with a short description of the information that will be presented and ends with a summary of the material that has been covered.
To use this book, you'll need a computer and operating system that support version 1.2 of the Java Development Kit. There are a wide variety of operating systems that support the JDK 1.2, including Windows 98, Windows 95, Windows NT, and Solaris. Ports of the JDK 1.2 to Linux, Macintosh OS, OS/2, and other operating systems are in the works. This book focuses on using Java under Windows 95, but all of the book's examples are pure Java and will run with any JDK 1.2 implementation (with the exception of those examples that show how to work with Microsoft's implementation of Java).
The CD-ROM that accompanies this book contains all the source code and complete applications found in the book. The CD-ROM is a hybrid that will work on Windows 95, Windows 98, Macintosh, and UNIX platform.
The best way to use this book is to start with Chapter 1, "What's New in JDK 1.2," and proceed through each chapter in order, working through each programming example that is presented. You will learn to use the JDK 1.2 by compiling, running, analyzing, and understanding the sample programs. You can get additional hands-on practice by tinkering with the sample programs, modifying them, and augmenting their capabilities.
© Copyright, Macmillan Computer Publishing. All rights reserved.