java container: 10, the difference between ArrayList and the Vector?

The difference between ArrayList and the Vector?

ArrayList和Vector:

(1) the underlying array are variable;
(2) the default of the array 10 are initial capacity. add procedure, the expansion of the array, but ArrayList expansion of 1.5 times, Vector expansion is doubled .
(3) thread safety : ArrayList is not thread-safe methods of Vector are used to provide synchronized modification, are thread-safe.

Reference may be linked: Java container --List interfaces (analog underlying code implementations ArrayList and LinkedList class)

Published 57 original articles · won praise 13 · views 1109

Guess you like

Origin blog.csdn.net/weixin_42924812/article/details/105054385