.NET 2.0-System.Collections.Generic.Collection和System.Collections.Generic.List有什么区别?

Anyone want to tell me what's the difference between System.Collections.Generic.Collection and System.Collections.Generic.List?

有谁想告诉我System.Collections.Generic.Collection和System.Collections.Generic.List有什么区别?

  • Collection<T> looks like a list, and it even has a List<T> internally.  EVERY single method delegates to the internal List<T>.  It includes a protected property that exposes the List<T>.

    Collection <T>看起来像一个列表,并且内部甚至还有一个List <T>。 每个单一方法都委托给内部List <T>。 它包括一个公开List <T>的受保护属性。

  • List<T> uses an array (T[]) internally and includes all this great anonymous delegate/predicate stuff like Find() and FindAll().

    List <T>在内部使用数组(T []),并包括所有这些出色的匿名委托/谓词,例如Find()和FindAll()。
  • They both implement IList and ICollection.

    它们都实现IList和ICollection。

Another weird one, Microsoft.VisualBasic still has the oddball Collection class that implements ICollection and IList.  Presumably this type exists only to help VB6 developers make the transition?

另一个怪异的Microsoft.VisualBasic仍然具有实现ICollection和IList的oddball Collection类。 大概存在这种类型只是为了帮助VB6开发人员进行过渡吗?

翻译自: https://www.hanselman.com/blog/net-20-whats-the-difference-between-systemcollectionsgenericcollection-and-systemcollectionsgenericlist

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值