6 min read
This study guide covers 2D arrays in Java, including initializing empty and pre-existing arrays (both rectangular and non-rectangular). It explains memory representation as nested arrays and graphical representation as grids/tables. The guide also details accessing elements using double-index notation (row, column), potential ArrayIndexOutOfBoundsExceptions, and provides practice questions using these concepts.
Give us your feedback and let us know how we can improve
Question 1 of 10
What is the correct syntax to declare an empty 2D integer array named 'grid' with 3 rows and 5 columns? 🚀
int[][] grid = new int[5][3];
int grid[][] = new int[3, 5];
int[][] grid = new int[3][5];
int[3][5] grid = new int[][];