(原创)(C#随笔)IEnumerable< ICollection < IList区别
来源:互联网 发布:淘宝运作团队 编辑:程序博客网 时间:2024/05/19 19:31
public interface IEnumerable { IEnumerator GetEnumerator(); }
再看ICollection<T>
public interface ICollection<T> : IEnumerable<T>, IEnumerable { void Add(T item); void Clear(); bool Contains(T item); void CopyTo(T[] array, int arrayIndex); bool Remove(T item); int Count { get; } bool IsReadOnly { get; } }
再看IList<T>
public interface IList<T> : ICollection<T>, IEnumerable<T>, IEnumerable { int IndexOf(T item); void Insert(int index, T item); void RemoveAt(int index); T this[int index] {get;set; } }可见,IList要比ICollection要多索引器的功能,另外还可以用索引器来进行修改,标识IList是可读写的链表,而ICollection是只读的链表;
- (原创)(C#随笔)IEnumerable< ICollection < IList区别
- C#中IEnumerable、ICollection、IList、List之间的区别
- C#中的 IList, ICollection ,IEnumerable 和 IEnumerator
- IEnumerable,ICollection,IList,List之间的区别
- IEnumerable,ICollection,IList,List之间的区别
- IEnumerable,ICollection,IList,List之间的区别
- IEnumerable,ICollection ,IList ,ArrayList
- IList,ICollection,IEnumerable辨析
- IList,ICollection,IEnumerable,IListIList,ICollection,IEnumerable辨析
- IList,ICollection,IEnumerable,IListIList,ICollection,IEnumerable辨析
- IList、ICollection、IEnumerable 之辨析
- IList,ICollection,IEnumerable,IEnumerator,IQueryable
- IEnumerable、ICollection和IList接口
- IList,ICollection,IEnumerable,IEnumerator,IQueryable
- public abstract class CollectionBase:IList,ICollection,IEnumerable
- IList,ICollection,IEnumerable,IEnumerator,IQueryable详解
- IEnumerable/ICollection/IList/List继承关系
- 如何选择使用IEnumerable, ICollection, IList
- Chrome控制台输入多行js
- 一张图看懂memwatch内存泄漏检测原理
- 普通项目转为maven项目
- Standard VMI
- 如何将maven项目打包成可执行的jar
- (原创)(C#随笔)IEnumerable< ICollection < IList区别
- 云计算学习后感--让家也变成“瘦客户端”
- NSDate和NSString的转换
- Access Violation
- HDU 1069 Monkey and Banana
- UVALive - 2911 Maximum
- Consignment VMI
- Android开发之数据存储SharedPreferences
- js用法