What is difference between arrayList and vector in java? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

What is difference between arrayList and vector in java?

Java

17th Jul 2018, 1:58 PM
Md Tarique Aziz
3 Respuestas
+ 1
A Vector is similar with ArrayList, but it is synchronized. ArrayList is a better choice if your program is thread-safe.Vector and ArrayList require space as more elements are added. Vector each time doubles its array size, whileArrayList grow 50% of its size each time.
17th Jul 2018, 2:01 PM
Lemuel
Lemuel - avatar
+ 1
Its performance on add and remove isbetter than Arraylist, but worse on get and set methods. Vector is similar withArrayList, but it is synchronized.
17th Jul 2018, 2:49 PM
Lemuel
Lemuel - avatar
0
is ArrayList faster than vector?
17th Jul 2018, 2:48 PM
Md Tarique Aziz