Static Initialization Blocks and their alternatives in JavaWhy do we need Static Initialization Blocks?The easiest way of initializing fields (static or instance) in Java at the time of their declaration is simply by providing a compile time constant value of a compatible data type. For example:public class InitializationWithConstants{public static int staticIntField = 100;private boolean
This post first appeared on Geek Explains: Java, J2EE, Oracle, Puzzles, And Problem Solving!, please read the originial post: here