更新时间:2023-11-26 20:30:46
在 15.10 数组创建表达式 JLS 说
[...] 创建指定长度的一维数组,并将数组的每个组件初始化为其默认值
[...] a single-dimensional array is created of the specified length, and each component of the array is initialized to its default value
以及 4.12.5 变量的初始值 它说:
对于类型int
,默认值为0,即0
.
For type
int
, the default value is zero, that is,0
.