This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes access inner class method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "access inner class method" Watch "access inner class method" New topic
Author

access inner class method

vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
say I got an inner class and have method A, how can the outer class access method A?

thanks
krishna avrs
Greenhorn

Joined: May 23, 2001
Posts: 4
If all are non-static then new outer().new inner().methodA();
If all are static then outer.inner.method();
If outer is static and inner is non-static then outer.new inner().method();
If outer is non-static and inner is static then new outer().inner.method();
Hope this helps!
Cheers!
SriKi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access inner class method