Question: Java Array Question In TwoDimensionalArray.java, we have a two dimensional array called twoDimArray and two one-dimensional arrays, arrayone and arrayTwo. You will copy the CONTENTS
Java Array Question


In TwoDimensionalArray.java, we have a two dimensional array called twoDimArray and two one-dimensional arrays, arrayone and arrayTwo. You will copy the CONTENTS of arrayone into twoDimArray[O] and the CONTENTS of arrayTwo into twoDimArray[1]. Use two nested loops and index 0 of the first dimension of twoDimArray means choosing arrayone as the array to copy and index 1 of the first dimension means choosing arrayTwo. public class TwoDimensionalArray ( public static void main(String[] args) { int[][] twoDimArray = new int[2][5]; int[] arrayOne = {5, 9, 55, 23, 89}; int[] arrayTwo = {15, 3, 23, 19, 64}; * /* copy arrayOne and arrayTwo into twoDimArray */ /* print out the first list of 5 numbers in twoDimArray on one line, and the second list of 5 numbers in twoDimArray on the next line */ * /* the solution should use nested loops: one loop to loop over * each array in twoDimArray, and one loop to loop over each element * in that array */ System.out.println("twoDimArray is " + twoDimArray); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
