int[][] myVals = {{10, 15, 20, 25}, {30, 35, 40, 45, 50, 55, 60}, {65, 70, 75, 80, 85, 90}};Using the above array, what is the value of myVals.length? What is the value of myVals[1].length? What is the value of myVals[2].length? Explain how you determined these values.
What will be an ideal response?
When working with a two-dimensional array, the length field holds the number of rows in the array. Each row, in turn, has a length field that holds the number of columns in the row.
The value of myVals.length is 3 because there are three rows in the array.
The value of myVals[1].length is 7 because there are seven columns in the second row of the myVals array.
Similarly, the value of myVals[2].length is 6 because there are six columns in the third row.
You might also like to view...
The point and click technique can only be used when writing a formula in a cell; it cannot be used with the Function Argument dialog box
Indicate whether the statement is true or false
The default color of bullets is based on the ________ of the presentation
A) color settings B) color effects C) slide layouts D) theme