Object-oriented programming in Java.
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: OuterClass.StaticNestedClass
E.g, Syntax is