Array Class

  1. Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime
  2. In my opinion,int32[] is an example of Array,so is double[] and so on.for instance:
        Int32[] ints = new int[];
//ints.GetType() {Name = "Int32[]" FullName = "System.Int32[]"} System.Type {System.RuntimeType} Array a = Array.CreateInstance(typeof(System.Int32), );
//a.GetType() {Name = "Int32[]" FullName = "System.Int32[]"} System.Type {System.RuntimeType}
 When to use: Array is strongly type,and is work well as parameter,if the the collection is fixed,we should should use Array instead of ArrayList.

ArrayList Class

  ArrlayList isn't strongly type,every Insertion or Retrial will need a cast to get back to your original type. If you need a method to take a list of a specific type, ArrayLists fall short because you could pass in an ArrayList containing any type,that is,we could contains Object,Int32,Double in the same ArrayList. ArrayLists use a dynamically expanding array internally, so there is also a hit to expand the size of the internal array when it hits its capacity.
  An ArrayList doesn't use a LinkedList as the internal data structure! It uses a vector which is an array that is dynamically resized on add/insert/delete operations.

  Actually,most of the time,the operations relevant to Array,such as Copy,IndexOf,Clear and so on.

List<T>

  Most of the time,we use List<T> and it contains all the advantages of Array and ArrayLists. It is strongly typed and it supports a variable length of items.

Ref:

  http://msdn.microsoft.com/en-us//library/system.array(v=vs.110).aspx  in msdn

  http://stackoverflow.com/questions/412813/when-to-use-arraylist-over-array-in-c  from StackOverflow

Array,ArrayList 和 List<T>的选择和性能比较.的更多相关文章

  1. 类 Array Arraylist List Hashtable Dictionary

    总结C# 集合类 Array Arraylist List Hashtable Dictionary Stack Queue  我们用的比较多的非泛型集合类主要有 ArrayList类 和 HashT ...

  2. c#中Array,ArrayList 与List<T>的区别、共性与转换

    本文内容来自我写的开源电子书<WoW C#>,现在正在编写中,可以去WOW-Csharp/学习路径总结.md at master · sogeisetsu/WOW-Csharp (gith ...

  3. Array,ArrayList、List<T>、HashSet<T>、LinkedList<T>与Dictionary<K,V>

    Array: 数组在C#中最早出现的.在内存中是连续存储的,所以它的索引速度非常快,而且赋值与修改元素也很简单. 但是数组存在一些不足的地方.在数组的两个数据间插入数据是很麻烦的,而且在声明数组的时候 ...

  4. 解析C#中[],List,Array,ArrayList的区别及应用

    [] 是针对特定类型.固定长度的. List 是针对特定类型.任意长度的. Array 是针对任意类型.固定长度的. ArrayList 是针对任意类型.任意长度的. Array 和 ArrayLis ...

  5. .net中的Array,ArrayList和List

    Array:任意类型,定长 ArrayList:任意类型,不定长 List:特定类型,不定长 Array和ArrayList是通过存储object类型实现可以存储任意类型数据,使用时需要拆箱和装箱

  6. [置顶] Array ArrayList LinkList的区别剖析

    这是一个面试中我们经常被问到的问题 Array.ArrayList.LinkList之间的区别:Array.ArrayList.LinkList均属于泛型的范畴,都用来存放元素,主要区别是Array是 ...

  7. C# 中的集合(Array/ArrayList/List<T>/HashTable/Dictionary)

    int [] numbers = new int[5]; // 长度为5,元素类型为 int.string[,] names = new string[5,4]; // 5*4 的二维数组byte[] ...

  8. Array,ArrayList,泛型List比较

    在C#中数组Array,ArrayList,泛型List都能够存储一组对象,但是在开发中根本不知道用哪个性能最高,下面我们慢慢分析分析. 一.数组Array 数组是一个存储相同类型元素的固定大小的顺序 ...

  9. C# 中的集合(Array/ArrayList/List<T>/HashTable/Dictionary)

    int [] numbers = new int[5]; // 长度为5,元素类型为 int. string[,] names = new string[5,4]; // 5*4 的二维数组 byte ...

随机推荐

  1. 【BZOJ2434-[Noi2011]】阿狸的打字机(AC自动机(fail树)+离线+树状数组)

    Description 阿狸喜欢收藏各种稀奇古怪的东西,最近他淘到一台老式的打字机.打字机上只有28个按键,分别印有26个小写英文字母和'B'.'P'两个字母. 经阿狸研究发现,这个打字机是这样工作的 ...

  2. bzoj1306

    非常好的一道搜索题首先没有别的好办法就只能搜,基于对称性我只要搜对角线上半部分即可然后有些惯用的剪枝啦什么的,具体见程序然后代码很短,然后TLE了(但好像也有人过了)然后就不知道怎么优化了,看到CLJ ...

  3. 微软开放技术发布开源的微软云服务器底盘管理器 (Chasis Manager) 软件

     发布于 2014-07-14 作者 陈 忠岳 今天,微软公司加入开放计算项目(OCP),贡献出硬件和软件规范,管理 API 和协议,机械 CAD 模型,以及电路板文件和 Gerbers(描述印刷 ...

  4. 【转】Eclipse使用git最简易流程

    原文网址:http://www.cnblogs.com/ZhangWanFan/p/3993733.html git有诸多好处,网上都说的很清楚了,在这里我不再赘述.对于我来说,私下里想做一些项目,而 ...

  5. 高德地图搜索提示获取信息回传activity刷新ui(二)

    应用场景: 在主activity中点击进入到另一个activity搜索提示,获取经纬度,点确定返回到主activity,虽然说需求很奇葩,但是遇到了没办法.. 主要包含两部分,搜索提示+activit ...

  6. Hibernate(六)一对一双向关联映射

    在上次的博文Hibernate从入门到精通(五)一对一单向关联映射中我们讲解了一下一对一单向关联映射, 这次我们继续讲解一下与之对应的一对一双向关联映射. 一对一双向关联 与一对一单向关联映 射所不同 ...

  7. 【原】Centos6.5下cdh4.6 hive安装部署

    1.前提条件:      只需要选择一台服务器即可,这里选择安装在namenode上:安装用户为cloud-user 2.安装包:      sudo yum install -y hive hive ...

  8. LayoutInflater作用及使用--自定义EditText,自带清除内容按钮

    作用: 1.对于一个没有被载入或者想要动态载入的界面, 都需要使用inflate来载入. 2.对于一个已经载入的Activity, 就可以使用实现了这个Activiyt的的findViewById方法 ...

  9. poj 1321 棋盘问题【dfs】

    棋盘问题 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28308   Accepted: 13996 Descriptio ...

  10. win8.1 无法安装 net framework3.5的解决办法

    近期给重装系统时,发现Windows8.1无法安装.net framework 3.5,即使我离线下载了安装文件,还要求安装2.0和3.0....而且无法从Windows更新中获取,因此百度到以下方案 ...