What is difference between IList and IList

前端 未结 3 1769
生来不讨喜
生来不讨喜 2021-01-13 03:32

Definition of List in .net shows it implement various interfaces.

public class List : IList, ICollection, I         


        
3条回答
  •  离开以前
    2021-01-13 04:01

    The reason that List implements both IList and IList is to make it usable anywhere your code is assuming an IList. This will make it more easier to make a transition to the generic IList since it is the more appropriate one. Also, if you have a .net 1.1 or earlier code that you would like to reuse even though your class is implemented in a .net 2.0 or later assembly it will make it possible.

提交回复
热议问题