Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
December 21, 2001
Is there a reason I cannot use numbers as part of package and import statements? For example, if my domain name is www.7ofHearts.com, and I want to create a package using my domain name, then:
does not compile, yet:
If I have an application that needs to import the above package, neither:
Is there a workaround, or are numbers not allowed in packages or import statements?
In Java, all identifiers must begin with a letter, an underscore, or a Unicode currency character. Any other symbol, such as a number, is not valid. Furthermore, an identifier cannot have the same spelling as one of Java's reserved words. (For a list of keywords and literals reserved from use as identifiers, see "3.9 Keywords" from the The Java Language Specification.)
In Java an identifier is anything used for the name of a declared entity. So an identifier includes all package, class, method,
parameter, and variable names. So in the case of
7ofHearts, you are simply out of luck.
My only suggestion: spell out "7." Try
com.sevenofhearts instead of
For more information on identifiers, be sure to check out "3.8 Identifiers" from The Java Language Specification.