主要区别在于Vector实现了多线程同步,而ArrayList没有。所以在多线程操作时用Vector,别的情况下用ArrayList好,因为效率要高。

解决方案 »

  1.   

    think in java上好像说过,Vector已经不被鼓励使用,具体原因不祥You’ll notice that the legacy classes Vector, Stack, and Hashtable are not included because in all cases there are preferred classes within the Java 2 Containers. 
      

  2.   

    Vector 不让用,那用什么来代替?线程安全+链表?
      

  3.   

    ArrayList类是容量可变的list接口的实现类,建立在一个数组结构基础上,这一数组是与vector结构对应的一种collection结构。arraylist类的功能与vector类似。但是没有被同步化。arraylist类支持collection接口和list接口中所有的可选方法,并且允许元素取任意值,包裹null。当一个arraylist对象的容量被扩展后,此对象容量被重新创建为指定容量大小。基础数组的使用使得可以使用索引值访问子对象,提高了arraylist的性能,使得在arraylist对象中访问子对象比在linkedlist对象中访问子对象效率更高。arraylist的缺点是插入元素和移走元素时工作效率比较低。