Java Tutorial, TheA Short Course on the Basics
This title is no longer available.
This title cannot be purchased online
The new edition of this popular book is updated to reflect v1.3 of the Java 2 Platform, Standard Edition as well as preceding versions as early as JDK 1.1, and includes Solaris, Linux and Win32. This new version is also streamlined—to cover the topics most needed—and includes questions and exercises at the end of each chapter (with answers on the CD). The authors' top-notch instruction is still present. Through a task-oriented, example-driven approach, the authors introduce students to fundamental concepts and applications. The book's unique, theme-based structure allows the flexibility to customize your own path through the specific information. To help beginners avoid many common mistakes, an entire chapter is devoted to programming problems and their solutions. The CD-ROM comes packed full of useful resources: a complete online tutorial of this book and the 2 other tutorial books, all major versions of the Java platform, versions 1.0.2 through 1.3 for the Solaris and Win32 platforms. The CD also includes the latest Java platform for Linux (Standard Edition v1.3) API documentation for the Java platform and source code for all examples.
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:
- All three Java™ Tutorial books in HTML: The Java™ Tutorial, The Java™ Tutorial Continued, and The JFC Swing Tutorial.
- All major versions of the Java platform, versions 1.0.2 through 1.3 for the Solaris and Win32 platforms. The latest Java platform for Linux, Standard Edition v1.3, is also included.
- API documentation for the Java platform.
- Source code for all examples.
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.
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.
2. Object-Oriented Programming Concepts.
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.
3. Language Basics.
Variables.Operators.Expressions, Statements, and Blocks.Control Flow Statements.Code Samples.
4. Object Basics and Simple Data Objects.
The Life Cycle of an Object.Characters and Strings.Numbers.Arrays.Code Samples.
5. Classes and Inheritance.
Creating Classes.Managing Inheritance.Implementing Nested Classes.Code Samples.
6. Interfaces and Packages.
Creating and Using Interfaces.Creating and Using Packages.Code Samples.
7. Handling Errors Using Exceptions.
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.
8. Threads: Doing Two or More Tasks at Once.
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.
9. I/O: Reading and Writing.
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.
10. User Interfaces that Swing.
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.
11. Applets for the Internet and Intranet.
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.
Appendix A. Common Problems and Their Solutions.
Getting Started Problems.General Programming Problems.Applet Problems.User Interface Problems.
Appendix B. Collections.
Appendix C. Deprecated Thread Methods.
Why Is Thread.stop Deprecated?Why Are Thread.suspend and Thread.resume Deprecated?What about Thread.destroy?Why Is Runtime.runFinalizersOnExit Deprecated?
Appendix D. Reference.
Java Programming Language Keywords.Operator Precedence.The APPLET Tag.POSIX Conventions for Command-Line Arguments.Integrated Development Environments.Classpath Help.
Mary Campione was formerly a senior technical writer at Sun Microsystems, where she started writing about the Java platform in 1995. Mary graduated from California Polytechnic, San Luis Obispo, with a B.S. in Computer Science and has worked as both a technical writer and programmer. Kathy Walrath is a senior technical writer on the Swing team at Sun Microsystems. After graduating from the University of California, Berkeley, with a B.S. in Electrical Engineering and Computer Science, Kathy wrote extensively about Unix, Mach, and NextStep. Since 1993, Kathy has been writing specifications and how-to guides for the Java platform.
Alison Huml is a technical writer at Sun Microsystems, where she joined The Java Tutorial team in 1997 and also works with the Security team. Alison received her B.A. in English from the University of California, Berkeley, and is currently pursuing her master's degree in Computer Science at Mills College.