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