Why does List implement IList, ICollection and IEnumerable?

前端 未结 4 875
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:20

    That's not the way it was actually coded behind the scenes. That's just what tools like Reflector show you when it turns the IL back into C#.

提交回复
热议问题