- It is a group of similar variables that would be referred by a common name.
- The element available in the array is accessed through index.
- This can be created and may have one or more dimension.
Types of arrays:
There are two main types of arrays are:
1. One-dimensional arrays
2. Multi-dimensional arrays
1. One-dimensional arrays
2. Multi-dimensional arrays
One-dimensional Arrays:
It’s a list of similar types of data. Before you create array you need to create a variable of any type.
Syntax:
Type variable-name [ ];
Int year_month [ ];
Syntax:
Type variable-name [ ];
Int year_month [ ];
Multi-dimensional Arrays
It is arrays of arrays need to specify each dimensional array variables, additional index using other square brackets represented as.
Int twoD [ ] [ ] = new int [6] [7];
Int twoD [ ] [ ] = new int [6] [7];
<<Previous Page Download PDF Next Page>>