Last Updated: 28 May, 2022
A multidimensional array is an array of arrays. It has more than one row and it represents the data in a tabular form (Rows and columns).
To access data or elements in the two-dimensional array we use row index and column index.
for example,
Two Dimensional (2D) Array represents in tabular form
Example 1: A Java Program of Two Dimensional (2D) Array
Output
1 2 3 4
5 6 7 8
9 0 1 2
Example 2: Two Dimensional Array - Declaration, Instantiation and Initialization in a single statement
Output
1 2 3
4 5 6
7 8 9
A Three Dimensional array is a group of one or more two-dimensional arrays, but it is a bit more complex than a two-dimensional array.
Example 3 : Three Dimensional Array (3D) in Java
Output
num[0][0][0] = 2
num[0][0][1] = 4
num[0][1][0] = 3
num[0][1][1] = 6
num[1][0][0] = 4
num[1][0][1] = 8
num[1][1][0] = 7
num[1][1][1] = 9
That's all guys, hope this Java article is helpful for you.
Happy Learning... 😀
feedback@javabytechie.com