nonSquare 1

This problem tests your knowledge of declaring and instantiating two-dimensional arrays in java, specifically non-squares (different row and column dimensions). Hint: remember RC! (RC-Cola, RaceCar, RiCe ... )

Complete the method nonSquare, which returns a 2D array with 2 rows and 3 columns containing all 7s.

2D Array Declaration and Instantiation:

type[][] name = new type[# rows][# cols];

ex:
int[][] data = new int[3][2];

2D Array Declaration and Initialization:

type[][] name = { row0, row1, ..., rowN }; //where is a row is a 1D array

ex:
int[][] test = { {1,2,3}, {1,2,3} };

Type your solution        
Skills Practiced:
3.C
3.E
4.A
4.B
Copyright © StudyCS 2024 All rights reserved.