Which two are valid declarations of a two-dimensional array?

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[];

Explanation:
int[][] array2D; is the standard convention to declare a 2-dimensional integer array.
int[] array2D[]; works as well, but it is not recommended.



Leave a Reply 0

Your email address will not be published. Required fields are marked *