Names

What is the difference between an identifier and a name? An identifier is just a sequence of letters and digits that don't match a keyword or the literals “true,” “false,” or “null.” A name, on the other hand, can be prefixed with any number of further identifiers to pin-point the namespace from which it comes. An identifier is thus the simplest form of name. The general case of name looks like the following:

package1.Package2.PackageN.Class1.NestedClass2.NestedClassM.memberN

Since packages can be nested in packages, and classes nested in classes, there can be an arbitrary number of identifiers separated by periods, as in:

java.lang.System.out.println( "goober" );

That name refers to the java.lang package. There are several packages ...

Get Just Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.