Java Static blocks example

Static Blocks Static Initialization

Generally, a Java programmer initializes variables in a constructor (or init() method in case of applet). It is the best place chosen, as the constructor is called implicitly when an object is created. Programmer creates objects before anything is done in coding (as object is required to call an instance…