View RSS Feed

Java Object

Static Nested Classes

Rate this Entry
by , 04-26-2012 at 05:58 PM (709 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:
Java Code:
E.g, Syntax is used so that to create an object, for sake of static nested class.
Java Code:
OuterClass.StaticNestedClass nestedObject =
     new OuterClass.StaticNestedClass();

Submit "Static Nested Classes" to Facebook Submit "Static Nested Classes" to Digg Submit "Static Nested Classes" to Submit "Static Nested Classes" to StumbleUpon Submit "Static Nested Classes" to Google