ArrayList and Vector ties and differences

Same point:

  • Use an array to achieve the underlying
  • The same function, and the like to achieve CRUD operations similar method
  • Variable-length array of structures

 

difference:

  • Vector is an early version of the JDK provided, ArrayList is a new version of an alternative Vector
  • Methods of Vector are synchronized, thread-safe; ArrayList non-thread-safe, but the performance is better than Vector
  • The default initial capacity is 10, Vector default double expansion, expansion of the size can be specified; only 50% increase in the ArrayList


 


 

All resources resources are summarized in the public No.



 

 

Guess you like

Origin www.cnblogs.com/ConstXiong/p/11891432.html
Recommended