Java Code Conventions
Sun has created a set of coding standards for Java, and published those standards in a document titled "Java Code Conventions".
The first letter should be capitalized, and if several words are linked together to form the name, the first letter of the inner words should be uppercase (a format is called as "camelCase").
For example:
Dog (Class)
Account (Class)
PrintWriter (Class)
Runnable (interface)
Serializable (interface)
The first letter should be lowercase, and then normal camelCase rules should be used.
For example:
getBalance
doCalculation
setCustomerName
Like methods, the camelCase format should be used, starting with a lowercase letter. Sun recommends short, meaningful names.
For example:
buttonWidth
accountBalance
myString
Java constants are created by marking variables static and final. They should be named using uppercase letters with underscore characters as separators.
For example:
MIN_HEIGHT
MAX_HEIGHT