Java Programming Standards

The following should appear at the beginning of each class:

/**
*  Purpose:
*  Date of last revision:
*  @version
*  @author
*/

(See http://java.sun.com/j2se/javadoc/writingdoccomments/index.html for examples.)

2.  The following should appear before each method:

/**
*  Purpose:
*  Date of last revision:
*  @version
*  @author
*  @param
*  @return
*/

3.  All variable names must be meaningful.

4.  Structures must be indented appropriately and all code between braces must be indented.

5.  All input must be prompted and all output must be labeled.

6.  Method main should consist mostly of method calls and methods should not be excessively long. (This applies after classes have been covered in class.)

7.  Identifier names must follow Java conventions: i.e. method and variable names must start with lowercase letters and classes with uppercase letters with each new word in the identifier names being capitalized.  Constants must contain all uppercase letters.

8. Include comments to describe blocks of code whose purpose is not immediately obvious, such as:

// The following while loop asks the user to input
// values until a valid integer is entered.

11.  Instance variables in classes must be declared to be private and may only be visible with accessor and mutator methods.