Vector vs. ArrayList which is better?

Possible Duplicate:
Why is Java Vector class considered obsolete or deprecated?

Which type is better to use and how to choice right type (memory usage, execution...)?


按照这个问题, Vector被认为是“过时的”,而是使用ArrayList


You should normally use ArrayList - it offers better performance.

Vector has just one "advantage" - it is synchronised for concurrent modification. But it turns out in practice that this feature isn't very useful because Vector synchronises at the level of each individual operation. If you are writing concurrent code, you typically need to lock at a much higher level of granularity than an individual collection class.

As a result, Vector is often considered deprecated nowadays.

链接地址: http://www.djcxy.com/p/76086.html

上一篇: ArrayList和Vector有什么区别?

下一篇: Vector与ArrayList哪个更好?