© { JSL }
28
Array Initialisation
·
arrays can be initialised
w
omitted initialisers are not permitted
w
array size may be omitted
w
standard shortcut notation
int
[] row =
new int
[4] {1,2,3,4};
int
[,] grid =
new int
[,] { {1,2,3}, {4,5,6,}, };
int
[,] shortcut = { {1,2,3}, {4,5,6} };
row
stack
heap
@
@
grid
1
2
3
4
1
2
3
4
5
6
trailing
commas
are
permitted