SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
Praise for The Java™ Tutorial, Second Edition
"This book stands above the rest because it has been available on the web and read by thousands of Java programmers. The authors have received an enormous amount of feedback about which sections are good and which sections are confusing; the confusing ones have been improved. I doubt that any other Java book has undergone such trial by fire...."
-Metroplex Java User Group, www.javamug.org/reviews/
Whether you're taking a class or learning on the job, The Java™ Tutorial, Third Edition, is a hands-on guide that lets you quickly become proficient with the Java programming language. Written by members of the Java Software team at Sun Microsystems, the book uses an interactive approach to help you learn the Java platform by example.
Since its first online release in 1995, the material in The Java™ Tutorial has been updated continuously to reflect reader feedback and new releases of the Java platform. This third edition has been thoroughly updated to cover v1.3 of the Java Platform, Standard Edition, as well as preceding versions as early as JDK 1.1.
You will find clear explanations of such fundamentals as objects, classes, and data structures. In addition, the book provides introductions to object-oriented programming, applet construction, and user interface design. Other topics include exceptions, I/O, and threads. To help beginners avoid many common mistakes, an entire chapter is devoted to programming problems and their solutions. Convenient summaries at the end of each section are new to this edition. Also new for this edition are "Questions and Exercises" sections to help you practice what you learn. The accompanying CD-ROM is filled with valuable resources, including:After working through the lessons in this proven tutorial, you will be well prepared to use the Java programming language in your school or workplace.
On the Road to Understanding Java
Click below for Sample Chapter related to this title:
campione.pdf
Preface.
1. Getting Started.
About the Java Technology.
How Will Java Technology Change My Life?
First Steps (Win32).
A Checklist.
Creating Your First Application.
Creating Your First Applet.
Error Explanations (Win32).
First Steps (UNIX/Linux).
A Checklist.
Creating Your First Application.
Creating Your First Applet.
Error Explanations (UNIX/Linux).
First Steps (MacOS).
A Checklist.
Creating Your First Application.
Creating Your First Applet.
Error Explanation (MacOS).
A Closer Look at HelloWorld.
Explanation of an Application.
The Anatomy of an Applet.
Code Samples.
What Is an Object?
What Is a Message?
What Is a Class?
What Is Inheritance?
What Is an Interface?
How Do These Concepts Translate into Code?
Summary.
Code Samples.
Variables.
Operators.
Expressions, Statements, and Blocks.
Control Flow Statements.
Code Samples.
The Life Cycle of an Object.
Characters and Strings.
Numbers.
Arrays.
Code Samples.
Creating Classes.
Managing Inheritance.
Implementing Nested Classes.
Code Samples.
Creating and Using Interfaces.
Creating and Using Packages.
Code Samples.
What Is an Exception.
The Catch or Specify Requirement.
Catching and Handling Exceptions.
Specifying the Exceptions Thrown by a Method.
How to Throw Exceptions.
Runtime Exceptions - The Controversy.
Advantages of Exceptions.
Summary of Exceptions.
Questions and Exercises.
Code Samples.
What Is a Thread?
Using the Timer and TimerTask Classes.
Customizing a Thread's run Method.
The Life Cycle of a Thread.
Understanding Thread Priority.
Synchronizing Threads.
Grouping Threads.
Summary of Threads.
Questions and Exercises: Threads.
Code Samples.
Overview of I/O Streams.
Using the Streams.
Object Serialization.
Working with Random Access Files.
And the Rest. . . .
Summary of Reading and Writing.
Questions and Exercises: Reading and Writing.
Code Samples.
Swing Overview.
Your First Swing Program.
Example Two: SwingApplication.
Example Three: CelsiusConverter.
Example Four: TravelWeather.
Example Five: Dialog Example.
Extras.
Look & Feel.
Layout Management.
Threads and Swing.
Supporting Assistive Technologies.
Visual Index to Swing Components.
Summary.
Questions and Exercises.
Overview of Applets.
AWT Components.
Taking Advantage of the Applet API.
Practical Considerations of Writing Applets.
Finishing an Applet.
For More Information.
Questions and Exercises.
Getting Started Problems.
General Programming Problems.
Applet Problems.
User Interface Problems.
Introduction.
Interfaces.
Implementations.
Algorithms.
Custom Implementations.
Interoperability.
Why Is Thread.stop Deprecated?
Why Are Thread.suspend and Thread.resume Deprecated?
What about Thread.destroy?
Why Is Runtime.runFinalizersOnExit Deprecated?
Java Programming Language Keywords.
Operator Precedence.
The APPLET Tag.
POSIX Conventions for Command-Line Arguments.
Integrated Development Environments.
Classpath Help.
Since the release of the Java Development Kit in May of 1995, the engineering team at Sun Microsystems has been hard at work improving and enhancing the Java platform. We have been similarly laboring to update The Java Tutorial to reflect the work of the engineers.
From the first page to the last, this edition now documents the APIs in the Java 2 SDK, Standard Edition, v 1.3. We have fully integrated SDK 1.3 updates into the text, plus we've added questions and exercises to help you practice what you learn. To help beginners avoid many common mistakes, an entire chapter is devoted to programming problems and their solutions. Convenient summaries at the end of each section are also new to this edition.
Like the first and second editions, this book is based on the online tutorial hosted at Sun Microsystem's Web site for the Java platform.
http://java.sun.com/docs/books/tutorial/index.html
Like the online version, this book reflects the latest advances in Java technology. Unlike the online version, this book solely focuses on the APIs needed by most beginning to intermediate programmers. Once you've mastered the material in this book, you can explore the rest of the Java platform on the Web site.
Our intent has always been to create a fun, easy-to-read, task-oriented programmer's guide with lots of practical examples to help people learn to program.
Who Should Read This Book?The book is geared towards both novice and experienced programmers.
No matter what type of programmer you are, you can find a path through this book that fits your learning requirements.
How to Use This BookThis book is designed so that you can either read it straight through or skip around from topic to topic. Whenever a topic is discussed in another place, you'll see a link to that place in the tutorial. Links are underlined and are followed by page numbers, like this: What Can Java Technology Do? (page 5).
All the sample code used in this book is available online and on the accompanying CD. The CD icon in the margin indicates that the code is available. At the end of each chapter there is also a "Code Sample" section with a table that specifies the locations of the examples on the CD and online.
We're dedicated to keeping this book up-to-date with the most current information. To learn what's new since this book went to press, visit the following URL:
http://java.sun.com/docs/books/tutorial/books/3e/index.html