[Contents] [Prev] [Next]

Code Conventions for the Java Programming Language

Last Revised August 29, 2000
  1. Introduction
    1. Why Have Code Conventions
  2. File Names
    1. File Suffixes
    2. Common File Names
  3. File Organization
    1. Java Source Files
      1. Beginning Comments
      2. Package and Import Statements
      3. Class and Interface Declarations
  4. Indentation
    1. Line Length
    2. Wrapping Lines
  5. Comments
    1. Implementation Comments
      1. Block Comments
      2. Single Line Comments
      3. Trailing Comments
      4. End of Line Comments
    2. Documentation Comments
  6. Declarations
    1. Number per Line
    2. Initialization
    3. Placement
    4. Class and Interface Declarations
  7. Statements
    1. Simple Statements
    2. Compound Statements
    3. return Statements
    4. if-else Statements
    5. for Statements
    6. while Statements
    7. do-while Statements
    8. switch Statements
    9. try/catch/finally Statements
  8. White Space
    1. Blank Lines
    2. Blank Spaces
  9. Naming Conventions
  10. Programming Practices
    1. Providing Access to Instance and Class Variables
    2. Referring to Class Variables and methods
    3. Constants
    4. Variable Assignments
    5. Misc. Practices
      1. Parentheses
      2. Returning Values
      3. Expressions before '?' in '?:'
      4. Special Comments
  11. Code Example
    1. Java Source File Example


[Contents] [Prev] [Next]