Basic HTML version of Foils prepared 19 July 97

Foil 20 Inner Classes - Member Classes

From Overview of JDK Version 1.1 Extensions CPS616 -- Information Track of CPS -- Spring Semester 97. by Nancy J. McCracken


Member classes introduce complications to the name space since there is now both scope (since a member class has a containing class) and inheritance (since a member class can have a superclass). Scope and inheritance form two distinct hierarchies.
If a member class refers to a name which is both in its containing class and its superclass, the name in the superclass is used as it is considered to be in the current scope, so inheritance takes precedence.
The Java compiler may require you to make this clear in the syntax by using this.x for an inherited name and A.this.x for a name in containing class A.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998