Arunan Ramanathan wrote:I have implemented an Protected inner class inside an abstract class, so all the first level of concrete classes extending the abstract class will have the visibility to the inner class right? (since it is protected). But second level of classes also can see the inner class. Am i wrong or i understood something wrong. Please clarify. Code chunk,
Well, there are two cases...
One, where you redefine the method(or class in this case) in the derived class (1st level derivation), with decreased visibility (private in this case)..
Second, where you don't redefine the method(or class), or redefine it with the same visibility but different functionality...
Now you can see, what happens to the visibility of the method(or class) in the 2nd level derivation in both the cases...
Not-Visible in 1st case, AND Visible in 2nd case..