Which of the following sets of statements creates a multidimensional array with 3 rows,where the first row contains 1 value,the second row contains 4 items and the final row contains 2 items ?
A)
int[][] items;
items = new int[3][?];
items[0] = new int[1];
items[1] = new int[4];
items[2] = new int[2];
B)
int[][] items;
items = new int[3][];
items[0] = new int[1];
items[1] = new int[4];
items[2] = new int[2];
C)
int[][] items;
items = new int[?][?];
items[0] = new int[1];
items[1] = new int[4];
items[2] = new int[2];
D)
int[][] items;
items[0] = new int[1];
items[1] = new int[4];
items[2] = new int[2];
Correct Answer:
Verified
Q40: Which statement below initializes array items to
Q65: Jagged arrays are maintained as arrays of
Q66: Multi-dimensional arrays require two or more indices
Q67: Variable-length argument lists allow you to create
Q68: Tables are often represented with rectangular arrays.
Q69: By convention,the first set of brackets of
Q71: In rectangular array items,which expression below retrieve
Q73: What is the keyword associated with variable-length
Q74: Which set of statements totals the items
Q75: Which of the following correctly declares and
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents