Hi,
I know there is much easier code and the example I took is perhaps not very
usefull (and maybe ...confusing) but uses the extended syntax for "member
classes" since Java 1.1.

How you could get an instance of inner class "InnerClass" from an object
(OuterClass)outer with access of all the members from outer?
I would prefer this way:
InnerClass inner = outer.new InnerClass();

There are differences between "member classes" and "nested top level
classes".

Bye

  



> -----Original Message-----
> From: Kirk Woll [mailto:[EMAIL PROTECTED]]
> Sent: Dienstag, 13. November 2001 20:16
> To: [EMAIL PROTECTED]
> Subject: RE: [Eap-features] Suggestions for inner classes
> 
> 
> My impression is that style is frowned upon.  In the same way that
> accessing static member variables and methods should not be 
> accessed via
> instance variables.  Instead, try using "new 
> OuterClass.InnerClass".  Or
> maybe that style is perfectly fine...and confusing. 
> 
> Kirk 
> 
> >-----Original Message-----
> >From: [EMAIL PROTECTED] [mailto:eap-features-
> >[EMAIL PROTECTED]] On Behalf Of Falk Friedrich
> >Sent: Tuesday, November 13, 2001 8:31 AM
> >To: '[EMAIL PROTECTED]'
> >Subject: [Eap-features] Suggestions for inner classes
> >
> >Hi,
> >if i would instantiate a inner class within outer class a know the
> syntax:
> >InnerClass inner = this.new InnerClass(parameter);
> >
> >Could you list all inner classes/interfaces if the construct "this."
> >followed by "new" appears? Maybe it's usefull if "new" after "this."
> will
> >be
> >suggest. The same way you could suggest "super" or "this" if someone
> tries
> >to access a field of outer class within inner class by using the
> explicit
> >way. The syntax must be something like that:
> >     OuterClass.this.field
> >or if I want to access a super class method:
> >     OuterClass.super.method()
> >
> >Thanks
> >
> >_______________________________________________
> >Eap-features mailing list
> >[EMAIL PROTECTED]
> >http://www.intellij.com/mailman/listinfo/eap-features
> 
> 
> _______________________________________________
> Eap-features mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-features
> 

_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to