nonSquare 2
This problem tests your knowledge of declaring and instantiating two-dimensional arrays in java, specifically non-squares (different row and column dimensions).

Complete the method nonSquare, which returns a 2D array with 3 rows and 1 column containing all -4s.

Hint: remember RC! (RC-Cola, RaceCar, RiCe ... )

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.