class test { publicstaticvoid main(String[] args) { A a =new A(); A.B b = a.new B(); A.B.C c = b.new C(); A.B.C.D d = c.new D(); d.print(); } }
class A { privateint index = 10; class B { privateint index = 9; class C { privateint index = 8; class D { privateint index = 7; voidprint() { System.out.println(this.index); System.out.println(D.this.index); System.out.println(C.this.index); System.out.println(B.this.index); System.out.println(A.this.index); System.out.println(A.B.this.index);