According to MSDN docs, System.Array
implements ICollection
, yet System.Array
does not provide a Count
property (of course you can always use the LINQ Count()
extension method, but there is no property with this name). How can this be? Isn't Count
required?
What are the interfaces implemented by Array class in C#? System. Array implements interfaces, like ICloneable, IList, ICollection, and IEnumerable, etc. The ICloneable interface creates a copy of the existing object i.e a clone.
The array size is limited to a total of 4 billion elements, and to a maximum index of 0X7FEFFFFF in any given dimension (0X7FFFFFC7 for byte arrays and arrays of single-byte structures). . NET Framework only: By default, the maximum size of an Array is 2 gigabytes (GB).
It's explicitly implemented like so:
int ICollection.Count
{
get
{
return Length;
}
}
You can read more about explicit interface implementation on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With