ArrayList vs Vector
ArrayList | Vector |
---|---|
Not Synchronized and so not thread safe | Synchronized therfore thread safe |
Fast in performance | Slow as it is thread safe |
Introduced first in java version 1.2 | Introduced first in java version 1.0 |
does not provide method to set increment size | setSize() method in Vector can set increment size |
ArrayList can only use Iterator for traversing | Vector uses both Enumeration and Iterator for traversing |
What is the difference between ArrayList and Vector in Java?