I’m puzzled about arrays in C#.
I can’t find any documentation on MSDN about for example the object double[].
I do find documentation about int, array, collections, … but can’t find out of what type double[] is. If I do double[] a = new double[10]; a.GetType(), I find that the type of a is System.Double[]
I believe that the type is not System.Double[], but must be some descendent of an object or interface in the System.Collections namespace or the System.Collections.Generic namespace. My best guess is that a double[] is a type that implements the interface System.Collections.IList, but I’m not sure at all.
So, could anyone explain me what kind of object an array of doubles (so an object double[]) really is? What are it’s base classes, which interfaces does it implement, …
Where could I find documentation on arrays of objects defined as int[], …, object[] ?
Thanks!
Array is a base class for all types of arrays int, double, string whatever, the base class for System.Array is System.Object. so the correct type is System.Double[]. It implements the ICloneable,
IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable interfaces as stated on msdn.
The main difference between arrays and collection is that arrays cannot be changed in size at runtime and arrays have to contain objects of same type as opposed to collections.