Actually the question is why the private fields of the nested static class are visible in the outer class?
- In jls-6.6.1 it is said: "§7.6) . " - zRrr
|
1 answer
A static nested class or interface is defined as a static member of the surrounding class, which makes it analogous to the field and method of the class, which are also declared as static. The nested class has access to members of its external class, including private members. However, the outer class does not have access to the members of the nested class.
Here is another good article.
|