Font size
Worksheets2D Array Test
Total questions: 20
Worksheet time: 45mins
Given the code, what is in values[2][1] ?
7.9
9.2
7.3
0.5
Given the code, what is the value of things.length ?
4
3
12
7
Given the following:
double [][] stuff ;
Which of the following statements constructs an array with 5 rows of 7 columns each and assign its reference to stuff ?
stuff = new stuff[5][7] ;
stuff = new double[5][7] ;
new stuff = double[5][7] ;
stuff = double new[5][7] ;
Given the code, which of the following fragments prints out every element of items?
Which of the following statements correctly declares a two-dimensional integer array?
int Matrix[ ] = new int[5,4];
int Matrix[ ]; Matrix = new int[5,4];
int Matrix[ ][ ] = new int[5][4];
int Matrix[ ][ ] = int[5][4];
What would the statement a[1].length return?
3
4
2
1
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
a
b
c
d
What are the contents of mat after the code has been executed.
