Difference between the static initializer block and regular static initialization

后端 未结 8 2066
广开言路
广开言路 2021-01-05 12:12

As the title says, what exactly is the difference between

public static String myString = \"Hello World!\";

and

public stat         


        
8条回答
  •  无人及你
    2021-01-05 12:38

    with static blocks you can change the order of the initialisation different to the order of declaration.

提交回复
热议问题