Studyon Minte9.com
Java SE




Inner Class




package testexample; public class Test { public static void main(String[] args) { new Test(); } public Test() { A a = new A(); System.out.println(a.var1); // Outputs: 1 A.B b = a.new B(); System.out.println(b.var2); // Outputs: 1 // cursive System.out.println(new A().new B().var2); } } class A { int var1 = 1; public void A() {} class B { int var2 = 2; public void B() {} } }
 


http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html