Back to marketplace

Unit 8 - 2D Array

No description yet. This curated deck is ready for daily study.

Total cards: 15•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (15)

#1
Front (Question)

2D array

Back (Answer)

An array of arrays Can be better way to store data Exp - seating chart of students

#2
Front (Question)

Rectangular 2D array

Back (Answer)

Each row array has same number of elements

#3
Front (Question)

Declaring a 2D array

Back (Answer)

DataType [ ] [ ] nameOf2DArray

#4
Front (Question)

Initializing a 2D array

Back (Answer)

Needs to know # of rows and columns new DataType [r] [c]

#5
Front (Question)

If you know what elements of 2D arrrays you want to include, you can

Back (Answer)

initialize the 2D array with a set of initializer lists

#6
Front (Question)

Initializer lists

Back (Answer)

Starts & ends with curly brackets {} Each row has its own initializer list Separating elements and initializer lists with commas {{“Alice”,”Rob”,”Cody”},{“Robin”,”Becky”,”Kisha”}}

#7
Front (Question)

We refer to 2D array’s size by

Back (Answer)

# of rows along with # of columns r by c

#8
Front (Question)

How to determine number of rows in a 2D array

Back (Answer)

r = grades.length

#9
Front (Question)

How to determine number of column in a 2D array

Back (Answer)

c = grades[0].length

#10
Front (Question)

How to access an element in a 2D array

Back (Answer)

name of array variable 2 sets of square brackets index of row where element is located index of row where element is located grade [5,2]

#11
Front (Question)

How to access an element in a 2D array

Back (Answer)

grade [5,2] = grade [5,2] + 1

#12
Front (Question)

How to create a new 2D array

Back (Answer)

DataType [ ] [ ] nameOf2DArray = new DataType [r][c]; String [ ] [ ] seating = new String [10][3}

#13
Front (Question)

In order to print out the contents of a 2D array,

Back (Answer)

you need to use for loops inside of for loops

#14
Front (Question)

In order to print out the contents of a 2D array, and you don’t know the specific dimensions,

Back (Answer)

you need to use nameOf2DArray.length for row and nameOf2DArray [0].length for column

#15
Front (Question)

Nested iteration statements can be written to traverse 2D array in

Back (Answer)

row-major order or column-major order