Card 6 / 13: Which two are valid instantiations and initializations of a multi dimensional array?
A)
int [] array = {0,1}; int [][][] array3d = new int [2][2][2]; array3d[0][0] = array; array3d[0][1] = array;
B)
int [][] array2d = new int [][2]; array2d[0][0] = 1; array2d[0][1] = 2;
C)
int [][][] array3d = {{0,1},{2,3},{4,5}}
D)
int [][] array2d = {{0,1,3,4,5},{3,4}};
Answer:
A) int [] array = {0,1}; int [][][] array3d = new int [2][2][2]; array3d[0][0] = array; array3d[0][1] = array;
D) int [][] array2d = {{0,1,3,4,5},{3,4}};
Previous Card | ← Previous Card Button |
Next Card | → Next Card Button |
Flip Card | Space-Bar |
|