| Identifier |
Rules for Naming |
Examples |
| packages |
the prefix of a unique package name is
always written in all-lowercase ASCII letters
and should be one of the top-level domain
names, currently com,edu,gov,mil,net,org,
or one of the english two-letter codes identfying
countries as specified in ISO standard 3166,1981.
Subsequent components of the package name
vary according to an organizations own internal
naming conventions. such conventions
might specify that certain directory name components
be division, department, project,
machine,or login names. |
com.sun.eng
com.apple.quicktime.v2
edu.cmu.cs.bovik.cheese |
| Classes |
Class names should be nouns, in mixed case
with the first letter of each internal word capitalized.
try to keep your class name simple
and descriptive. use whole word-avoid
acronyms and abbreviations (unless the abbreviation
is much more widely used than the
long form,such as URL or HTML). |
class Raster;
class ImageSprite; |
| Interface |
Interface names should be capitalized like
class names. |
interface RasterDelegate;
interface Storing; |
| methods |
Methods should be verbs, in mixed case with
the first letter lowercase, with the first letter of
each internal word capitalized. |
run();
runFast();
getBackground(); |
| Variables |
Except for variables,all instance,class and
class constants are in mixed case with a lowercase
first letters. internal words start with capital
letters. variable names should not start with
underscore_or dollar sign $ characters,even
though both are allowe. |
i;
c;
myWidth; |
| Constants |
the names of variables declared class constants
and of ANSI constants should be all
uppercase with words separated by underscore ("_").(ANSI should be
avoided, for ease of debugging.) |
static final
|