| 本帖最后由 曾振华 于 2013-10-9 22:51 编辑 
 class Outer
 {
 int x = 3;
 void method()
 {
 class Inner
 {
 void function()
 {
 System.out.println(Outer.this.x);
 }
 }
 new Inner().function();
 }
 }
 
 
 
 
 
 class  InnerClass
 {
 public static void main(String[] args)
 {
 new Outer().method();
 }
 }
 
 
 
 
 局部内部类 class Inner前,为什么不能被 private、static修饰呢?
 
 这个内部类中的方法 void function()为什么也不能被 static修饰呢?
 |