zoukankan      html  css  js  c++  java
  • C#中的数组、ArrayList、List<T>的区别

    自己的理解

    1.数组:

    优点:(内存中)存储连续、索引快速、可以多维、类型长度固定

    缺点:需指定长度、插入数据效率低

    2.ArrayList:(System.Collections) 可“克隆”

    优点:无需指定长度(动态扩容)、可存储不同类型的数据(同时也是缺点)、插入数据效率高

    缺点:不可多维、非类型安全的、修改数据易出错、操作数据效率较低(因为存储的是Object类型,操作需要装箱拆箱)

    3.List<T>:(System.Collections.Generic)

    优点:无需指定长度(动态扩容)、类型安全的(通过T指定相应类型)、插入数据效率高

    缺点:不可多维

    参考:http://www.jb51.net/article/45929.htm

    http://blog.csdn.net/zhang_xinxiu/article/details/8657431

  • 相关阅读:
    zoj1137 poj1466
    poj3041
    zoj1455
    hdu1160 FatMouse's Speed
    zoj2770
    hdu1469
    hdu3169
    Mapped exception to response: 500 (Internal Server Error)
    Mapped exception to response: 500 (Internal Server Error)
    object is not a function
  • 原文地址:https://www.cnblogs.com/wangweiabcd/p/4175885.html
Copyright © 2011-2022 走看看