????1.Vector??
????API?????????
????Vector?????????????????????顣???????????????????????????????????з??????????????Vector ???С?????????????????С??????????? Vector ????????????????????
????java.util.vector??????????(vector)???????????????????????Java???????????????????????????????????????????????????????????????c??c++????ν??“???????”??????????????????????????Java????????????????????????vector???????????????????????????????????????????????????????????????????????????????????á?
???????????????????????????????????????????????????????????????????????????????????????????????в??????????????????????????????С????????????????в??????????????????????????????????????
????Vector?????????ArrayList??????????????????????????????????????Synchorized?????????????е?Ч?????ArrayList?????
????Vector??ArrayList?????
??????1??????????????
????Vector:
????protected Object[] elementData;
????ArrayList??
????private transient Object[] elementData;
????(2)?????
????Vector?????????????????????????????????дVector????????????д????????????????????????????????????????????????ArrayList????
??????Vector???е?isEmpty???????:
????public synchronized boolean isEmpty() {
????return elementCount == 0;
????}
????public boolean isEmpty() {   //ArrayList??
????return size == 0;
????}
??????3????治?????????С
????ArrayList????治???????????1.5??
private void grow(int minCapacity) {
// overflow-conscious code
int oldCapacity = elementData.length;
int newCapacity = oldCapacity + (oldCapacity >> 1);
if (newCapacity - minCapacity < 0)
newCapacity = minCapacity;
if (newCapacity - MAX_ARRAY_SIZE > 0)
newCapacity = hugeCapacity(minCapacity);
// minCapacity is usually close to size?? so this is a win:
elementData = Arrays.copyOf(elementData?? newCapacity);
}
//oldCapacity>>1??????λ?????????????2??1?η???????????0.5????CPU??????λ????????Ч?????