As the title says, what exactly is the difference between
public static String myString = \"Hello World!\";
and
public stat
with static blocks you can change the order of the initialisation different to the order of declaration.
A static variable stores a value that is shared between all instances (or the non-instance) of the Class it is defined in.
A static block is a section of code that gets executed when Class is first loaded.
"regarding scope, static block is accssible only in the same class"," whereas static variable can be accessed from any class"