容器-数组-Vector

1. Vector概要:
  • 默认长度为10
                  /**
     * Constructs an empty vector so that its internal data array
     * has size {
@code 10} and its standard capacity increment is
     * zero.
     
*/
    
public Vector() {
    
this(10);
    }
  • 底层采用数组存储protected Object[] elementData;
  • 线程安全
  • 查询效率比较高,比较适用于查询
  • 扩容的长度为初始长度的一半,建议初始化的时候设置已知的长度,免得容器自己去扩容,浪费空间以及效率
    与ArrayList基本一样,除了所有操作资源的方法都加了
    synchronized,保证线程同步
    这里的源代码就不详解了,具体请参考容器-数组-ArrayList详解

posted on 2012-02-20 16:11 陈睿 阅读(242) 评论(0)  编辑  收藏 所属分类: 高级


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

统计

常用链接

留言簿

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜