NESTED STATIC CLASS

 
Nested Static class is static member of top level class..
The Inner class which declared as static will called as static Nested Class..
To create any instance of inner or nested class ,we require instance of outer class but this is not required in case of static nested class.
we can create instance of static inner class without any instance of outer level class..
 
1
2
3
4
5
6
7
8
9
10
11
12
public class NestedStaticClass {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        NestedStaticClass.NestedClass  nestedclass=new NestedStaticClass.NestedClass();
        nestedclass.method();
    }
    static class NestedClass{
        void method(){
            System.out.println("This is Static Nested Class.");
        }
    }
}

Output of the program is given below:

This is Static Nested Class..