The Java Language Tutorial
is a practical, on-line guide to writing programs in the Java language.
Note:
This document reflects the Java Developer's Kit (Version 1.0 Beta) release.
This guide is a DRAFT. It's incomplete, buggy, and contains links to "ghost" lessons (lessons that we are working on and that aren't yet available). We're making this guide available to you for two reasons:To help us with #2, please let us know what's confusing in these lessons, what seems unnecessary, and whether the lessons helped you at all. Write us at java@java.sun.com or submit a bug report.
- So you can learn from it -- some of the information in this guide is not documented anywhere else.
- So we can get feedback on this guide.
The Trail Map describes the trails and lessons that are currently available.
Upgrades, Bug Fixes, and Face-Lifts. Oh My!
For the third draft, we've:
- made the few changes necessary to reflect Beta instead of Pre-Beta.
- changed the name of this document from "The Java Programmer's Guide" to "The Java Language Tutorial: Object-Oriented Programming for the Internet." Why the long name? This document is going to be published as a book, and we wanted to make sure the title was as descriptive as possible, without requiring much prior knowledge of the potential buyer.
- added ALT text to our link graphics, so that people using non-graphical browsers can understand the information the graphic was conveying.
Here are the changes that occurred between the second and first drafts:
- Everything was updated to reflect the new APIs (except for The "run:" Protocol Handler and The "text/plain" Content Handler in the Getting Started
trail).
- We fixed many typos, clarified many obfuscations, fixed broken links and miscommunications.
- We got a face-lift with new icons and a new page design.
New Trails and New Lessons
We've added a few pages to the third draft:
![]()
- The Creating a User Interface trail has a new lessons:
![]()
- The Writing Applets trail has a new lesson: The Anatomy of an Applet which describes how applets work and how you use the Applet class to create an applet.
![]()
- The new Creating a User Interface trail has two new lessons: Anatomy of a Program with a Graphical UI which explains the Component hierarchy and how it relates to event handling and drawing.
![]()
- We've added a trail The Java Development Environment that provides a tour of the packages provided with the development environment, talks about the different tools including the new prototype debugger. This trail includes a lesson on Using System Resources.
![]()
- We've also added the Integrating Native Methods into Java Programs trail that shows you how to integrate native methods into your Java programs. Currently, this trail contains two lessons. The first, Step By Step, walks you through an example showing you each step you take to implement a native method. The second, A Comprehensive Example, which is largely unfinished, is an example that implements a "character-replacement" program using native methods.
![]()
- And finally, two new lessons have been added to the Writing Java Programs trail: Threads of Control and Object-Oriented Programming Concepts: A Primer.
Applet references in these pages actually contain references to two different versions of the applet:
- a 1.0alpha3 compatible version which you can view these using the 1.0alpha3 version of the HotJava browser
- a Beta-compatible version which you can view these using the appletviewer or other Beta-compatible browser
Note to 1.0alpha3 Developers: This programmer's guide doesn't contain any information on how to upgrade your 1.0alpha3 Java applets to the 1.0 Beta release. For more information on how to do this please refer to Converting Applets.
You can download the Programmer's Guide in the following formats.
- ftp://java.sun.com/docs/progGuide.html.tar.Z
- HTML files in compressed tar format for UNIX machines.
Approximate size when compressed: 720K
Approximate size when uncompressed: 1,415K
- ftp://java.sun.com/docs/progGuide.ps.tar.Z
- PostScript files in compressed tar format for UNIX machines.
Approximate size when compressed: 503K
Approximate size when uncompressed: 1,780K
Note: There is one PostScript file for every HTML file in the programmer's guide (which is a lot). Also, in the PostScript files images are replaced with their alternate text, or if no alternate text is specified, with "[IMAGE]".- ftp://java.sun.com/docs/progGuide.html.zip
- HTML files in zip format for DOS machines.
Approximate size when compressed: 644K
Approximate size when uncompressed: 1,415K
- ftp://java.sun.com/docs/progGuide.ps.zip
- PostScript files in zip format for DOS machines.
Approximate size when compressed: 680K
Approximate size when uncompressed: 1,780K
Note: There is one PostScript file for every HTML file in the programmer's guide (which is a lot). Also, in the PostScript files images are replaced with their alternate text, or if no alternate text is specified, with "[IMAGE]".