Identifiers use only ASCII letters and digits, and, in a small number of cases noted below, underscores. Thus each valid identifier
name is matched by the regular expression \w+
.
- Package names are all lowercase, with consecutive words simply concatenated together (no underscores, not camel-case).
- Class names are written in UpperCamelCase.
- Method names are written in lowerCamelCase.
- Constant names use
CONSTANT_CASE
: all uppercase letters, with words separated by underscores. - Non-constant field names (static or otherwise) are written in lowerCamelCase.
- Parameter names are written in lowerCamelCase (one-character parameter names in public methods should be avoided).
- Local variable names are written in lowerCamelCase.