I recently noticed that all arrays in C# inherit from the IList interface but you can't really handle an array like a standard list.
Why was this inheritance introduced in .net and C#
I recently noticed that all arrays in C# inherit from the IList interface but you can't really handle an array like a standard list.
Why was this inheritance introduced in .net and C#
It is often useful to be able to pass any IList
to some algorithm. That algorithm might just care about being able to index into this collection. Many things fulfill this requirement: Arrays, List<T>
, many custom collections.