Java Reference
In-Depth Information
• A member class or member interface M declared in another class C has a canonical
name if and only if C has a canonical name.
In that case, the canonical name of M consists of the canonical name of C , fol-
lowed by “ . ”, followed by the simple name of M .
• An array type has a canonical name if and only if its component type has a canon-
ical name.
In that case, the canonical name of the array type consists of the canonical name of
the component type of the array type followed by “ [] ”.
A local class does not have a canonical name.
Example 6.7-2. Fully Qualified Names v. Canonical Name
The difference between a fully qualified name and a canonical name can be seen in
code such as:
package p;
class O1 { class I {} }
class O2 extends O1 {}
Both p.O1.I and p.O2.I are fully qualified names that denote the member class I , but
only p.O1.I is its canonical name.
Search WWH ::




Custom Search