You need to read the whole thing to get the context:
Except for variables, all instance,
class, and class constants are in
mixed case with a lowercase first
letter. Internal words start with
capital letters. Variable names should
not start with underscore _ or dollar
sign $ characters, even though both
are allowed.
Variable names should be short yet
meaningful. The choice of a variable
name should be mnemonic- that is,
designed to indicate to the casual
observer the intent of its use.
One-character variable names should be
avoided except for temporary
"throwaway" variables. Common names
for temporary variables are i, j, k,
m, and n for integers; c, d, and e for
characters.
So [local] variables are to be short (meaning they may not have enough "words" to have mixed case).
All other variables (those at the instance or class level, the non-local ones) are to be have mixed case and start with a lower case letter (and presumably be "wordy" enough to be able to have mixed case, like "lineNumber" instead of "number");
EDIT (forgot about constants).
There are two ways of looking at constants in Java:
- anything with the word final
- anything with a guaranteed value
that is always the same
so:
class Foo
{
public final int variable;
public final int CONSTANT;
static
{
variable = // generate a random number.
CONSTANT = 5;
}
}
Here "variable" is "constant" in that once it is assigned a value it cannot change, but it is not a constant like "CONSTANT" since "CONSTANT" will always have a value of 5.
I consider #2 to be the only constants in Java.
EDIT #2 (in response to the comment below).
I would re-write that as:
Except for local variables, all
instance, class, and class blank
finals [and I might also specify that
the blank final be without have a
single compile time value] are in
mixed case with a lowercase first
letter.
You can look at http://www.codeguru.com/java/tij/tij0071.shtml for some more of a description.