Member classes can access private member variables of other member classes (in the same top-level class) the same way they can access public members of other member classes. That is, the word private does not prevent the access, but there can still be other things which prevent it. In this case, since inner1var and inner2var are nonstatic member variables, you need to have an instance of inner1 or inner2 to access them. This has nothing to do with public or private - it's true for any instance variable. You need an instance of the class that declares it. Try this:
"I'm not back." - Bill Harding, Twister
Joined: Feb 06, 2005
Thanks for the ur replies .. I was thinking the same .. so can we conclude saying that the enclosing class cann't have direct access to the members of the inner classes?