


The following lines of code show you the declaration of a multidimensional rectangular array: By specifying additional dimensions at declaration we can declare a rectangular array. Rectangular arrays : Rectangular arrays are those arrays in which each row contains an equal number of columns.

NET multidimensional arrays are of two types Rectangular arrays and Jagged arrays. The following code show you how to change the size of the declared arrays: We should use the Preserve keyword to preserve the existing data when reinitializing an array, because when we use ReDim statement all the data contained in the array is lost. To change the number of elements in an array you can use ReDimstatement. For this we use ReDim statement which assigns a completely new array object to the specified array variable. Sometime we have a situation in which we have to change the size of an array after creating them. WriteLine( "Name of the Student in the fourth location" & " " & Student(3)) The dimensionality of an array is used to identify an individual element. NET we can have up to 32 dimensions and their size are is not fixed. One dimension arrays are linear arrays and more than one dimension arrays are multidimensional arrays. We must specify the number of elements in the array. We can declare arrays by using Dim, ReDim, Static, Private, Public and Protected keywords. Arrays inherit from the Array class in the System namespace. NET all arrays are start from zero, which means that the index of the first element in the array is zero. Arrays have an upper bound the starting index of the array and a lower bound the ending index of the array. They are programming constructs that store data and by numeric index or subscript they allow us to access that data. When we want to store similar types of values or objects, for this we generally use Arrays.
