Professional Documents
Culture Documents
Multidimensional Array
One Dimensional Arrays
One dimensional arrays (1D arrays) is a list of the variable of
similar data types. It allows random access and all the
elements can be accessed with the help of their index. The
size of this array is fixed. Represented below:
Example of an 1D Array
First Element Last Element
This creates a two-dimensional array with 3 rows and 3 columns, where the
first row contains the values 1, 2, and 3, the second row contains the values
4, 5, and 6, and the third row contains the values 7, 8, and 9.
Activity
i. Write a statement that declares an Integer array named
intQuantities. The array should have four rows and two
columns.
Syntax: arrayName[rowIndex][columnIndex];
Example of How Arrays are stored
For our previously declared array age is stored in this format