Java Reference
In-Depth Information
mil , net , or org , or one of the English two-letter codes identifying countries as specified
in ISO Standard 3166 .
The name of a package is not meant to imply where the package is stored on the
Internet. The suggested convention for generating unique package names is merely
a way to piggyback a package naming convention on top of an existing, widely
known unique name registry instead of having to create a separate registry for package
names.
For example, a package named edu.cmu.cs.bovik.cheese is not necessarily obtainable
from Internet address cmu.edu or cs.cmu.edu or bovik.cs.cmu.edu .
In some cases, the Internet domain name may not be a valid package name. Here are
some suggested conventions for dealing with these situations:
• If the domain name contains a hyphen, or any other special character not al-
lowed in an identifier (§ 3.8 ) , convert it into an underscore.
• If any of the resulting package name components are keywords (§ 3.9 ) , ap-
pend an underscore to them.
• If any of the resulting package name components start with a digit, or any
other character that is not allowed as an initial character of an identifier,
have an underscore prefixed to the component.
Names of packages intended only for local use should have a first identifier that be-
gins with a lowercase letter, but that first identifier specifically should not be the iden-
tifier java ; package names that start with the identifier java are reserved for package of
the Java SE platform.
Class and Interface Type Names
Names of class types should be descriptive nouns or noun phrases, not overly long, in
mixed case with the first letter of each word capitalized.
Example 6.1-2. Descriptive Class Names
ClassLoader
SecurityManager
Thread
Dictionary
BufferedInputStream
Likewise, names of interface types should be short and descriptive, not overly long,
in mixed case with the first letter of each word capitalized. The name may be a de-
Search WWH ::




Custom Search