ArrayList
declares that it implements the IList
, ICollection
, and IEnumeralbe
interfaces.
Why not only implement IList
, because IList
is also derived from ICollection
, and ICollection
is derived from IEnumerable
.
What's the purpose of this kind of declaration? There are many cases like this in .NET BCL.
There is no effective difference. I believe the extra declarations are there for clarity.
When checked in Reflector, classes which in code implement IList
have the same interface declaration list as classes which in code declare implementing all of Ilist
, ICollection
and IEnumerable
.
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