就是java的一种数据结构,用来存储数据的,但可以动态伸缩,不需要象数组那样必须定义时指定大小。具体用法看jdk api吧。
解决方案 »
- 面试的一道算法题
- linux下如何替换不可见的回车换行字符
- 正则表达式\Z 与\z两个翻译理解是不是一样?怎么理解它?
- netbeans6.5里面错误怎么不能自动修改了?
- ******不明白Iterator 的用法
- 这个 java.lang.NullPointerException 是什么原因啊?
- 急求《JAVA实例技术手册 第二版》光盘中的实例代码!
- 如何在长整形里面定位其每个字节,或者直接把一个8个字节的字节数组(byte[8])赋给长整形?急!!!!!
- udp socket server端必须要先开启吗?
- 求教Java SE中集合框架查询的方法
- 如何刷新整个页面的一部分?
- 如何创建这个对象啊?
可以增加
有长度sizeof()
可以离开
可以用循环变量依次读取
你可以找个连接池的例子,里面有这方面的语句。
Class Vector
java.lang.Object
|
+-java.util.AbstractCollection
|
+-java.util.AbstractList
|
+-java.util.Vector
public class Vector
extends AbstractList
implements List, RandomAccess, 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. Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs. Since:
JDK1.0
See Also:
Collection, List, ArrayList, LinkedList, Serialized Form
JDK API有具体的用法
可以从www.javasoft.com上 下载API