Home » Oracle » 1z0-803 » Which two are valid declarations of a two-dimensional array?
Which two are valid declarations of a two-dimensional array?
A. int [] [] array2D;
B. int [2] [2] array2D;
C. int array2D [];
D. int [] array2D [];
E. int [] [] array2D [];
Correct Answer: AD
Explanation/Reference:
Explanation:
int[][] array2D; is the standard convention to declare a 2-dimensional integer array.
int[] array2D[]; works as well, but it is not recommended.
Incorrect answers:
int[2][2] array2D;
The size of the array cannot be defined this way.
int array2D[]; is good definition of a one-dimensional array.
int[] []array2D[];is good definition of a three-dimensional array.
Download Printable PDF. VALID exam to help you PASS.
|
|