ArrayList, Vector main difference

Vector is thread-safe, but the performance is lower than the ArrayList.

ArrayList, Vector is the main difference between the following points:

(1): Vector is thread-safe, there are a lot of synchronized source code can be seen, rather than ArrayList. Vector and ArrayList result in efficiency can not be compared;

(2): ArrayList and Vector are continuous linear memory space, when the storage space is insufficient, increasing the ArrayList original default 50%, Vector is increased to twice the original default;

(3): Vector can set capacityIncrement, but not ArrayList, from the literal meaning is the capacity capacity, Increment increased capacity growth parameters.

Published 28 original articles · won praise 24 · views 10000 +

Guess you like

Origin blog.csdn.net/XM_no_homework/article/details/103871543