public class Vector
extends AbstractList
implements List, Cloneable, Serializable
The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created.Each vector tries to optimize storage management by maintaining a capacity and a capacityIncrement. The capacity is always at least as large as the vector size; it is usually larger because as components are added to the vector, the vector's storage increases in chunks the size of capacityIncrement. An application can increase the capacity of a vector before inserting a large number of components; this reduces the amount of incremental reallocation. As of the Java 2 platform v1.2, this class has been retrofitted to implement List, so that it becomes a part of Java's collection framework. Unlike the new collection implementations, Vector is synchronized.The Iterators returned by Vector's iterator and listIterator methods are fail-fast: if the Vector is structurally modified at any time after the Iterator is created, in any way except through the Iterator's own remove or add methods, the Iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the Iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future. The Enumerations returned by Vector's elements method are not fail-fast. 

解决方案 »

  1.   

    Vector是向量,是java.util.中的一个类。
    有点类似于数组。
    一般这样实例化一个向量。java.util.Vector vObj = new java.util.Vector() ;
    一般用:vObj.addElement("abc")来对向量增加值。
    用vObj.elementAt(i)来取值。i为vObj中数据的索引。
    如:
    String sStr = "" ;
    for(int i=0;i<vObj.size();i++)
        sStr = (String)vObj.elementAt(i);用向量的好处:对向量增加值时不必要预先知道向量的长度有多大。
    比数组要灵活。更详细的说明你可去查参考资料。
      

  2.   

    vector是某种数据结构,例如数组,列表等也是数据结构一样vector的操作非常简单,加元素一般用addElement方法,访问用elementAt方法,删去用removeElementAt方法,就行了,呵呵这种数据结构优点如楼上所说,缺点就是稍耗资源具体可看书
      

  3.   

    http://www.precisejava.com/javaperf/j2se/Collections.htm
    讲了一些Collections的性能评测(包括:Vector,ArrayList,LinkedList),或许看完后就知道Vector是什么,和其他的集合的比较有什么优点和缺点了.可以用于那一方面的应用了.
      

  4.   

    http://www.precisejava.com/javaperf/j2se/Collections.htm
    讲了一些Collections的性能评测(包括:Vector,ArrayList,LinkedList),或许看完后就知道Vector是什么,和其他的集合的比较有什么优点和缺点了.可以用于那一方面的应用了.