public class test1 {
private int outProp=9;
class Inner
{
private int inProp=10;
public void acessOutProp(){
System.out.println("外部类的outProp值:"+outProp);
}
}
public void accessInnerProp(){
//外部类不能直新年好访问非静态内部类的实例Field
//下面代码不能通过编译
//System.out.println("内部类的inProp值:"+inProp);
System.out.println("内部类的inProp值:"+new Inner().inProp);
}
public static void main(String[] args){
test1 out=new test1();
out.accessInnerProp();