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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top