what is difference between static block and static method in java?
Static methods can be accessed directly in static and non-static methods. Static block is mostly used for changing the default values of static variables. This block gets executed when the class is loaded in the memory. ... A static block is specific to Java, and executes when the class is first initialized.