The information on this page is for Archive Purposes Only
This page is not being actively maintained. Links within the documentation may not work and the information itself may no longer be valid. The last revision to this document was made on April 20, 1999
For an example of a Java program properly formatted, see "Java Source File Example" on page 19.
Each Java source file contains a single public class or interface. When private classes and interfaces are associated with a public class, you can put them in the same source file as the public class. The public class should be the first class or interface in the file.
/* * Classname * * Version information * * Date * * Copyright notice */
package java.awt; import java.awt.peer.CanvasPeer;
The following table describes the parts of a class or interface declaration, in the order that they should appear. See "Java Source File Example" on page 19 for an example that includes comments.
Part of Class/Interface Declaration
See "Documentation Comments" on page 9 for information on what should be in this comment.
These methods should be grouped by functionality rather than by scope or accessibility. For example, a private class method can be in between two public instance methods. The goal is to make reading and understanding the code easier.