Is there anything like static class
in java?
What is the meaning of such a class. Do all the methods of the static class need to be static
Can a class be static in Java ?
The answer is YES, we can have static class in java. In java, we have static instance variables as well as static methods and also static block. Classes can also be made static in Java.
In java, we can’t make Top-level (outer) class static. Only nested classes can be static.
static nested class vs non-static nested class
1) Nested static class doesn’t need a reference of Outer class, but Non-static nested class or Inner class requires Outer class reference.
2) Inner class(or non-static nested class) can access both static and non-static members of Outer class. A static class cannot access non-static members of the Outer class. It can access only static members of Outer class.
see here: https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html