Originally posted by parag:
Since method2 is defined in the inner class C, all the variables and methods present in the super classes are visible to it. hence method1 in Class B, and variable X (public) and variable Y ( private) are also visible to it, since they in turn are visible to class B. am i clear. however the vice-versa is not clear.
thankyou parag
The answer for above is a,b,c.becoz inner class can access all the var./methods of an enclosing class.this is the 1st rule.
and a 2nd rule:an inner class cannot access a var. in a sub class of an enclosing class without a reference to it,so d is not correct.could anyone tell me which book has mentioned the above 2nd rule.
hema