Want this question answered?
A static class is a class where all the members are declared static.
class diagram for payroll system
A toplevel class certainly can be static. Static has nothing to do with the level of a class.
A static class may or may not have static members. Adding the static keyword to the class definition won't change this. Note that an inner class which is not static may not contain static members (unless those members are also declared final).
by creating class as an static class
Local variables (on the stack) or dynamically allocated variables (in the heap) are nonstatic variables. Static variables, constants and globals are all allocated in the program's data segment.
An inner class declared as static is treated as if it were a normal top-level class.
Declaring an inner class static means that class only has access to the "outer" class public and private static fields. A non-static inner class has access to the outer class's instance data. Top-level classes cannot be declared static. The advantage of a static inner class is that it doesn't need an instance of the containing class to work and it's bytecode class size is smaller for that reason - less overhead.
A static member variable is local to the class rather than to an object of the class.
Static java method is the same as a static variable. They belong to a class and not an object of that class. If a method needs to be in a class, but not tied to an object, then one uses static java.
Static Blocks are always executed first. A static block is executed when your class is charged but a static method is executed only when is called, therefor first the class is charged and then is executed a method.
Static member variables are local to the class. That is, there is only one instance of a static member variable, regardless of how many objects are instantiated from the class. As such, they must be declared inside the class, and defined outside of the class.