日期:2014-05-20 浏览次数:20791 次
class Outer{ private int size; class Inner{ void doSuff(){ size++; System.out.println("The size value of the Outer class: " + size); } } } public class TestInner { public static void main(String[] a) { Outer out = new Outer(); Outer.Inner in = out.new Inner();//声明并创建内部类对象 in.doSuff(); } }