Why does List implement IList, ICollection and IEnumerable?

前端 未结 4 876
Happy的楠姐
Happy的楠姐 2020-12-05 17:32

If you go to definition of List you would see the following:

public class List : IList, ICollection, IEnumer         


        
4条回答
  •  难免孤独
    2020-12-05 18:38

    Yes it would. IList itself implements the other two.

    The object browser shows you all the interfaces the class implements, whether directly (IList) or indirectly (ICollection, IEnumerable, through IList).

提交回复
热议问题