为什么外部Java类可以访问内部类私有成员?
class ABC{
class XYZ{
private int x=10;
}
public static void main(String... args){
ABC.XYZ xx = new ABC().new XYZ();
System.out.println("Hello :: "+xx.x); ///Why is this allowed??
}}
ibeautiful
婷婷同学_
HUX布斯
随时随地看视频慕课网APP
相关分类