ArrayList读源码心得

  首先给一个ArrayList和LinkedList速度方面的比较

        ArrayList  LinkedList

    增加:    慢      快

    删除:    慢      快

    修改:    快      快

    查询:    快      慢

如果认真阅读LinkedList算法详解就能对LinkedList各方面速度应该有所了解

下面对ArrayList的操作总体介绍,ArrayList所有操作都是建立在他内部封装的一个Object[]数组以及size:

/*** The array buffer into which the elements of the ArrayList are stored.* The capacity of the ArrayList is the length of this array buffer. Object[] elementData;/*** The size of the ArrayList (the number of elements it contains).** size;,香港虚拟主机,香港虚拟主机,香港服务器人生重要的不是所站的位置,而是所朝的方向

ArrayList读源码心得

相关文章:

你感兴趣的文章:

标签云: