public class StaticTnnerClassTest
{
privata int prop1 = 5;
private Static int prop2 = 9;
static class StaticInnerClass
{
private static int age;
public void accessOuterProp()
{
System.out.println(prop1);
System.out.println(prop2);
}
}
}
为什么静态内部类的实例方法也不能访问外部类的实例属性呢? |
|