6.5. Determining the Meaning of a Name

The meaning of a name depends on the context in which it is used. The determination of the meaning of a name requires three steps:

• First, context causes a name syntactically to fall into one of six categories: PackageName, TypeName, ExpressionName, MethodName, PackageOrTypeName, or AmbiguousName.

• Second, a name that is initially classified by its context as an AmbiguousName or as a PackageOrTypeName is then reclassified to be a PackageName, TypeName, or ExpressionName.

• Third, the resulting category then dictates the final determination of the meaning of the name (or a compile-time error if the name has no meaning).

PackageName:    Identifier    PackageName . IdentifierTypeName:    Identifier    PackageOrTypeName ...

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition 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.