© { JSL }
32
Ragged Initialisation
·
each sub array can be intialised as before
w
you can only specify the first dimension
int
[][] ragged =
new int
[3][4];
int
[][] ragged =
new int
[3][]
{
new int
[2],
null
,
new int
[4]{ 1, 2, 3, 4 }
};
ragged
stack
heap
@
@
null
@
0
0
1
2
3
4
{ ... }
shorthand
allowed
here
but not
here
compile time error