1.

Difference Between Arraylist And Vector In Java?

Answer»
  • ARRAYLIST is not synchronized WHEREAS Vector is synchronized.
  • Performance wise ArrayList is fast in comparison to Vector as ArrayList is not synchronized.
  • ArrayList, by default, grows by 50% in case the initial capacity is EXHAUSTED. In case of Vector the backing array's size is doubled by default.
  • For TRAVERSING an ArrayList iterator is used. For traversing Vecor Iterator/Enumerator can be used. NOTE that Iterator is fail-fast for both Vector and ArrayList. Enumerator which can be used with Vector is not fail-fast.



Discussion

No Comment Found