Array is a collective name given to some value that have similar type of value. Data values in an array called aray elements. The sequence location from the element is shown by a subscript or an index.
According to dimencies, array can be distinguished to :
1. One-Dimensional Array
One-dimensional array is kind of basic array and the most often used, the usage especially used in String type.
- Each element of array can be accessed by index
- Index of array by default started from 0
- Array declaration :
Type_of_Array Name_of_Array[size] ;
2. Two-Dimensional Array
Two-Dimensional array is an array that consist by m rows and columns. The shape looks like matrixs or tables.
- . Array Declaration :
Type_of_Array Name_of_Array[row][column];
3. Multidimensional Array
Multidimensional array is an array that has size more than two. The declaration form same with one-dimensional array or two-dimensional array.
- . Array Declaration :
Type_of_Array Name_of_Array[size 1][size 2]....[size n]
Differences of array and others data type :
- Array can has many values, whereas other data type only can be connected only with one value.
- Array can be used to save some values of data type (include: int, float, char, double, etc) that is same with only one name
- Moreover, array can be one dimension or more than it, whereas the other type just can be one dimension