What is the scope of variables declared inside a static block in java?

One Two Three picture One Two Three · Mar 30, 2012 · Viewed 9.4k times · Source

Are variables declared inside a static block accessible anywhere else? What "kind" of member are they(ie., are they static member, too?)

Answer

AJD301 picture AJD301 · Mar 30, 2012

Generally programmers don't need to declare any variables inside static blocks, usually this is only for ensuring initialization of static variables for use by all instances of class (depending on scope of static variable).

Variables declared inside a static block will be local to that block just like methods and constructors variables.

JDK Docs