This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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.
 
 
subject: access inner class method
 
Similar Threads
RHE Chapter 6, Question 9
Can I access private members of inner class
Accessing private inner class members
nested inner classes
the Quession about static of inner class