3.8. Arrays

The System.Array class contains methods to manipulate arrays. The elements of an Array can be of any type, as everything in .NET is an object and derives directly or indirectly from the System.Object, Array, stores System.Object elements. To find the type of array declaration, we use the GetType method. The Length property specifies the total number of its elements or the number of elements it can contain. The Rank property returns the number of dimensions in the array. To find out whether or not the array has a fixed size, we use the IsFixedSize property. Fixed size arrays do not allow us to add and remove elements. Such arrays only support the modification of existing elements. Arrays may be read only. To find this out, we should ...

Get A Programmer's Guide to .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.