What is a Multidimensional array in Java?

In Java, a multi-dimensional array is nothing but an array of arrays.

2D array − A two-dimensional array in Java is represented as an array of one-dimensional arrays of the same type. Mostly, it is used to represent a table of values with rows and columns −

Int[][] myArray = {{10, 20, 30}, {11, 21, 31}, {12, 22, 32} }

In short, a two-dimensional array contains one-dimensional arrays of elements. It is represented by two indices where the first index denotes the position of the array and the second index represents the position of the element within that particular array −

Monica Mona
Monica Mona

Student of life, and a lifelong learner