Java / Class Variables (Static Variables)
What is a static class in Java?
A Class can be made static only if it is a nested class (class within a class). The nested static class can be accessed without having an object of outer class.
It can access static data members of outer class including private. Static nested class cannot access non-static data member or method.
If you have the static member inside static nested class, it can be accessed directly and you don't have to create instance of static nested class.
The static class are also known as static nested class or static inner class .
More Related questions...