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. 小测几种python web server的性能

    http://blog.csdn.net/raptor/article/details/8038476 因为换了nginx就不再使用mod_wsgi来跑web.py应用了,现在用的是gevent-ws ...

  2. VLD(Visual LeakDetector)内存泄露库的使用

    VLD简介 由于C/C++语言没有所谓的垃圾收集器,内存的分配和释放都需要程序员自己来控制,这会给C/C++程序员带来一定的困难.当您的程序越来越复杂时,它的内存管理也会变得越来越困难.内存泄漏.内存 ...

  3. jinfo命令(Java Configuration Info)

    jinfo可以输出并修改运行时的java 进程的opts.用处比较简单,用于输出JAVA系统参数及命令行参数.用法是jinfo -opt  pid 如:查看2788的MaxPerm大小可以用  jin ...

  4. 深入浅出Node.js (11) - 产品化

    11.1 项目工程化 11.1.1 目录结构 11.1.2 构建工具 11.1.3 编码规范 11.1.4 代码审查 11.2 部署流程 11.2.1 部署环境 11.2.2 部署操作 11.3 性能 ...

  5. HUD --- 3635

    Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficu ...

  6. git入门超详细(转载)

    转自:http://www.cnblogs.com/tugenhua0707/p/4050072.html Git使用教程 一:Git是什么? Git是目前世界上最先进的分布式版本控制系统. 二:SV ...

  7. JavaScript高级程序设计12.pdf

    第六章 面向对象的程序设计 ECMA中有两种属性:数据属性和访问器属性 数据属性的特性 [[Configurable]] 表示是否通过delete删除属性,是否重新定义属性,是否能把属性修改为访问器属 ...

  8. python 3 操作 excel

    看到一篇很好的python读写excel方式的对比文章: 用Python读写Excel文件 关于其他版本的excel,可以通过他提供的链接教程进行学习. XlsxWriter: https://git ...

  9. java读取图片的(尺寸、拍摄日期、标记)等EXIF信息

    1.metadata-extractor是 处理图片EXIF信息的开源项目,最新代码及下载地址:https://github.com/drewnoakes/metadata-extractor 2.本 ...

  10. Rebuild my Ubuntu 分类: ubuntu shell 2014-11-08 18:23 193人阅读 评论(0) 收藏

    全盘格式化,重装了Ubuntu和Windows,记录一下重新配置Ubuntu过程. //build-essential sudo apt-get install build-essential sud ...