For a change, I'll talk about programming...
In .net 3.5, all arrays derive from the System.Array class.
Code:
(this piece of code proves it:
Console.WriteLine(new int[] { 1, 2, 3 }.GetType().BaseType);)
//System.Array
System.Array derives from System.Object.
System.Array implements the following interfaces:
System.ICloneable
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.IList
but after running this code
Code:
Type t = new int[0].GetType();
Type[] tt = t.GetInterfaces();
foreach (Type u in tt)
Console.WriteLine(u);
I discovered that arrays not only inherit the implementation of the above interfaces but also (if I'm reading this properly) implement IList<T>, ICollection<T>, IEnumerable<T>.
can someone explain the reasoning behind arrays' implementing those 3 generic interfaces rather than having System.Array implement them and then letting the arrays inherit those implementations?