语言:Java
版本:12.0.2
字符串源代码如下:
/* @implNote
* The actual value for this field is injected by JVM. The static
* initialization block is used to set the value here to communicate
* that this static final field is not statically foldable, and to
* avoid any possible circular dependency during vm initialization.
*/
static final boolean COMPACT_STRINGS;
static {
COMPACT_STRINGS = true;
}
Run Code Online (Sandbox Code Playgroud)
如何理解这句话:“静态初始化块用于在此处设置值以传达此静态最终字段不可静态折叠,并避免在vm初始化期间出现任何可能的循环依赖性。”