Declare and Allocate
Declare and allocate two-dimensional array:
int [ ] [ ] b;
b = new int [3] [2];
Note: b.length is 3 and b[0].length is 2.
Assigning to array elements could yield:
b[0][0] 5
b[0] b[0][1] 3
b[1][0] 8
b[1] b[1][1] -1
b[2][0] 7
b[2] b[2][1] -5
Previous slide
Next slide
Back to first slide
View graphic version