Array initialization is to obtain the fixed capacity of the array. The {"","",""} method can obtain the fixed capacity of the array and assign a value to each element.
new String[3] can also tell the compiler the fixed capacity of the array, and by the way, set each element to null,
However, the two methods of standardizing the fixed capacity of the array at the same time may cause conflicts in syntax,
For example, new String[4]{"","",""},
So in order to avoid such ambiguity, this way of writing that also regulates the array capacity should be prohibited from a grammatical perspective
Array initialization is to obtain the fixed capacity of the array. The
{"","",""} method can obtain the fixed capacity of the array and assign a value to each element.
new String[3] can also tell the compiler the fixed capacity of the array, and by the way, set each element to null,
However, the two methods of standardizing the fixed capacity of the array at the same time may cause conflicts in syntax,
For example, new String[4]{"","",""},
So in order to avoid such ambiguity, this way of writing that also regulates the array capacity should be prohibited from a grammatical perspective
The grammar is stipulated in this way. . .
It has nothing to do with virtual machines
https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.10.1
The array applies for a fixed size memory area