int[][] myVals = new int[3][]
myVals[0] = new int[3];
myVals[1] = new int[10];
myVals[2] = new int[5];
?
The above code depicts a jagged array. What does this mean? Describe the rows and columns that make up this array.
What will be an ideal response?
In a two-dimensional array, each row also is an array. In Java, you can declare each row to have a different length. When a two-dimensional array has rows of different lengths, it is a jagged array because you can picture the ends of each row as uneven. You create a jagged array by defining the number of rows for a two-dimensional array, but not defining the number of columns in the rows.?The array is defined as follows:int[][] myVals = new int[3][]?This statement declares an array with three rows, but the rows are not yet created. Then, the individual rows are declared using the following statements:myVals[0] = new int[3];myVals[1] = new int[10];myVals[2] = new int[5];?myVals[0] has 3 elements/columns.myVals[1] has 10 elements/columns.myVals[2] has 5 elements/columns.
You might also like to view...
Which formatting flag indicates that the floating-point values should be output with a thousands separator?
a. plus (+). b. minus (-). c. comma (,). d. period (.).
What are the advantages of polymorphism?
What will be an ideal response?
Why is it necessary to introduce some methods and documentation from plan-based approaches when scaling agile methods to larger projects that are developed by distributed development teams.
What will be an ideal response?
Consider a pair of processes X and Y that use the communication service B to communicate with one another. Suppose that X is a client and Y a server and that an invocation consists of a request message from X to Y (that carries out the request) followed by a reply message from Y to X. Describe the classes of failure that may be exhibited by an invocation.
What will be an ideal response?