Style
Java offers the following conventions for writing identifiers. See the Java Code Conventions.
An identifier begins with a letter, an underscore or a currency symbol (e.g. $ ). This initial letter can be followed by any number of letters, digits, underscores or currency symbols.
The prefix of a unique package name is written in all-lowercase ASCII letters and should be one of the top-level domain names. Subsequent components of the package name vary according to an organization's own internal naming conventions.
package: com.sun.eng
Classes and interfaces should be nouns, in mixed case with the first letter of each internal word capitalized.
class: Clock
class: ImageSprite
interface: Storing
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized
i: run ( -- )
i: runFast ( -- )
: getBackground ( -- )
Variables are written in mixed case with a lowercase first letter. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.
Standard types are written in lower case. Class types are written like classes, the first letter is capitalized.
int i
float frameWidth
Clock myClock
The names of constants should be all uppercase with words separated by underscores.
static final int MIN_WIDTH
1998-2013 Wolf Wejgaard