The array data type is a fundamental data type in most languages, including Visual Basic. An array is used to store a collection of similar data types or objects.
Many authors of programming books misuse the terms associated with arrays, so let’s begin by establishing the correct terminology. In fact, if you will indulge us, we would like to begin with a formal definition of the term array.
Let S1, S2 ..., SN be finite sets, and let T be a data type (such as Integer). Then an array of type T is a function:
arr:S1 · S2 · ... · SN T
where S1 · S2 · ... · SN is the Cartesian product of the sets S1, S2 ..., SN. (This is the set of all n-tuples whose coordinates come from the sets Si.)
For arrays in VB.NET (and the other languages that implement the Common Language Runtime), the sets Si must have the form:
In other words, each set Si is a finite set of consecutive integers starting with 0.
Each position in the Cartesian product is referred to as a coordinate of the array. For each coordinate, the integer Ki is called the upper bound of the coordinate. The lower bound is 0 for all arrays in VB.NET.
The number N of coordinates in the domain of the function arr is called the dimension (or sometimes rank) of the array. Thus, every array has a dimension (note the singular); it is not correct to refer to the dimensions of an array (note the plural). An array of dimension 1 is called a one-dimensional array, an array of dimension ...