CollectionBase List property

  • Thread starter Thread starter Sunit Joshi
  • Start date Start date
S

Sunit Joshi

Hello
The doc says that the List property of CollectionBase returns an IList
object. If that is so, then why I'm able to do
List.CopyTo(System.Array, int index) which is again of type
ICollection.CopyTo ?? Since both the IList and ICollection interfaces
do not have a CopyTo member defined..??


thanks
Sunit
 
Sunit said:
Hello
The doc says that the List property of CollectionBase returns an IList
object. If that is so, then why I'm able to do
List.CopyTo(System.Array, int index) which is again of type
ICollection.CopyTo ?? Since both the IList and ICollection interfaces
do not have a CopyTo member defined..??

ICollection interface has *CopyTo* method declaration.
So, if you look at "about" *IList* interface then you'll find
that it inherits *ICollection* (that has *CopyTo*).

Marcin
 
Back
Top