wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
Consider Paul's rocket mass heater.
 
subject: access inner class method
 
Similar Threads
Can I access private members of inner class
Accessing private inner class members
RHE Chapter 6, Question 9
the Quession about static of inner class
nested inner classes