If it is an Array of objects it will be initialized with null
, if it’s an array of primitive values (like int
) it will be initialized with 0
. For the non-number primitive boolean
it is false
and for ‘char’ it is '\u0000'
. For more information, check the table Default Values on the following page:
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
2
solved What value is stored in an initialized but empty integer array in Java [closed]