java中 为什么访问外部类的属性 必须加this?
第15句:System.out.println("外部类中的name:" + HelloWorld.name ); 这样写HelloWorld.name已经清晰的表明是外部类的name属性了, 为什么必须加上this哪?(HelloWorld.this.name)
第15句:System.out.println("外部类中的name:" + HelloWorld.name ); 这样写HelloWorld.name已经清晰的表明是外部类的name属性了, 为什么必须加上this哪?(HelloWorld.this.name)
2015-07-03
举报