Alex Rivera | Logout

How do arrays in C# partially implement IList<T>?

Asked 2012-06-22T20:01:11.217
107

So as you may know, arrays in C# implement IList<T>, among other interfaces. Somehow though, they do this without publicly implementing the Count property of IList<T>! Arrays have only a Length property.

Is this a blatant example of C#/.NET breaking its own rules about the interface implementation or am I missing something?

Edit
Report

1 Answer

10

Explicit interface implementation. In short, you declare it like void IControl.Paint() { } or int IList<T>.Count { get { return 0; } }.

answered 2012-06-22T20:04:26.433

Your Answer