[Kaffe] ease of use patch.

Alexandre Oliva oliva at dcc.unicamp.br
Wed Feb 24 12:02:35 PST 1999


On Feb 24, 1999, Archie Cobbs <archie at whistle.com> wrote:

> Alex Blewitt writes:
>> Incidentally, inner classes are horrible IMHO and in order to achieve an
>> inner class, many 'friendly/local' variables are actually made
>> package-scope instead of private to allow intra-object access.

> Could you elaborate on this, eg, with an example? I don't see
> what you're talking about.

It's not that private variables are ``promoted'' to package-protected
ones; package-protected accessor methods are may be created to grant
access to private variables of a class to its inner classes.

class foo { private int bar; class baz { int foobar() { return bar; }}}

there will be an accessor bar$something() that baz.foobar() will call
to obtain the value of foo.bar.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil



More information about the kaffe mailing list