Difference between ArrayList and Vector in Java
Features | ArrayList | Vector |
---|---|---|
Thread Safety | ArrayList is not thread safe | Vector is thread safe |
Performance | As ArrayList is not synchronized, it provides better performance than Vector | As Vector is synchronized, it performs slightly slower than ArrayList |
Legacy Code | ArrayList is not considered a legacy code | Vector class is considered a legacy code and is due for deprecation |