Multi-dimensional Arrays

In this lesson, we discuss multi-dimensional arrays.

Dynamic multi-dimensional arrays #

Arrays of arrays are called multi-dimensional arrays. The elements of all of the arrays that we have defined so far have been written in the source code from left to right. To help us understand the concept of a two-dimensional array, let’s define an array from top to bottom this time:

int[] array = [
               10,
               20,
               30,
               40
              ];

As you remember, most spaces in the source code are used to help with readability and do not change the meaning of the code. The array above ...