Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
A 2D array is a data structure that stores values in a grid-like format with rows and columns. It allows for efficient storage and retrieval of data elements.
Related terms
firstDimension: The first dimension of a 2D array refers to the number of rows it has. It determines the vertical size or height of the grid.
secondDimension: The second dimension of a 2D array refers to the number of columns it has. It determines the horizontal size or width of the grid.
element: An element is an individual value stored within a 2D array. Each cell in the grid contains one element, which can be accessed using its row and column indices.