public class Test8 {
//外部类成员
private String name="aaa";
private void outName(){
System.out.println(name);
}
//内部类
public class Test{
//内部类成员
private int id=100;
private void outId(){
System.out.println(id);
Test8 test8 = new Test8();
test8.outName();
System.out.println(Test8.this.name);
}
}
public static void main(String[] args){
Test test = new Test();
test.outId();
}
}
这样做为什么不行啊!!纳闷 |