日期:2014-05-20 浏览次数:20652 次
class Outer { Inner in; Outer() { in = new Inner(); } public class Inner { public Inner() { System.out.println("inner of Outer"); } } } public class SubOuter extends Outer { class Inner { public Inner() { System.out.println("inner of SubOuter"); } } public static void main(String[] args){ SubOuter.Inner in1 = new SubOuter().new Inner(); Outer.Inner in2 = new Outer().new Inner(); } }