包含内部类的外部类,在这个外部类里面,也可以使用内部类本身private的字段。
Otherwise, if the member or constructor is declared private, then access is permitted if and only if it occurs within the body of the top level class (§7.6) that encloses the declaration of the member or constructor.
具体讨论见
https://stackoverflow.com/questions/1801718/why-can-outer-java-classes-access-inner-class-private-members
Sign in to make a reply
a_bumpy_night
包含内部类的外部类,在这个外部类里面,也可以使用内部类本身private的字段。
Otherwise, if the member or constructor is declared private, then access is permitted if and only if it occurs within the body of the top level class (§7.6) that encloses the declaration of the member or constructor.
具体讨论见
https://stackoverflow.com/questions/1801718/why-can-outer-java-classes-access-inner-class-private-members