Learning objectives
Declare and create a rectangular two-dimensional array with new or with an initializer list, access an element as arr[row][col], and state the default values of its elements
Use arr.length for the number of rows and arr[r].length for the number of columns, and treat a single row arr[r] as a one-dimensional array
Traverse a two-dimensional array in row-major and in column-major order with nested for loops, and with nested enhanced for loops whose outer variable is a one-dimensional array
Write code that finds a sum, average, maximum or minimum, or counts or tests elements for a property, over the whole grid or along one row, one column or another region such as a diagonal or the border
Write code that searches a two-dimensional array row by row, detects duplicates or neighboring pairs, or shifts or rotates the elements of one row or one column
Write code that builds a new two-dimensional array from an existing one, such as its transpose or a grid in which each value depends on its neighbors
Continue with a revision plan
These learning objectives are available to everyone. Sign in with an eligible plan to read the full note and worked examples.
