0
What is the difference between the static and non static block
how static block is used for initialization
3 Respuestas
+ 7
Static is like puting hospital patients in quarantine
so the condition of the patients does not effect people outside of quarantine.
+ 6
Static is isolated
non-Static is not
+ 3
The static block is called only once when the containing class is accessed for the first time.
Whereas, the non-static block is called every time a new instance is created, just before the constructor.
Also visit http://www.bullraider.com/java/core-java/scjp-ocjp/290-static-non-static-block for more detailed comparison