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开发人员进行过渡吗?