zuai-logo

2D Array

Listen to this study note

AP Computer Science A Study Guide

2D Arrays

Quick Fact

šŸ’” A 2D array in Java is essentially an array of arrays, forming a table-like structure with rows and columns.

Declaration and Initialization

  • Declaration: To declare a 2D array, you specify the data type, followed by two sets of square brackets (one for rows, one for columns), and the array name.

java int[][] matrix; // Declar...