The Java® Language Specification, Java SE 7 Edition, Fourth Edition
by James Gosling, Bill Joy, Guy Steele, Gilad Bracha, Alex Buckley
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access