posted 11 years ago
A static nested class behaves as any other top-level class. A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class.
Static nested classes are accessed using the enclosing outer class name:
"Outer.D"
For example, to create an object for the static nested class, use this syntax :
Outer.D nestedObject = new Outer.D();
For non-static nested classes you can create object as :
Outer.D nestedObject = new Outer().new D();
OR,
Outer outer = new Outer();
Outer.D nestedObject = outer.new D();