Static Nested Classes
by, 04-26-2012 at 05:58 PM (533 Views)
A static nested class also has a link with the outer class just the same way with class methods & variables. Just like static class methods, it is not possible for the static nested class to directly refer to the instance variables which have been defined in the enclosing class. This means that they can be used just via object reference.
Static nested classes can be accessed by the enclosing class name:
E.g, Syntax is used so that to create an object, for sake of static nested class.Java Code:OuterClass.StaticNestedClass
Java Code:OuterClass.StaticNestedClass nestedObject = new OuterClass.StaticNestedClass();