Ask Question
29 November, 15:58

How ArrayList and Vectors are different and in what case we should use Array and in what case we should use Vectors

+5
Answers (1)
  1. 29 November, 18:23
    0
    ArrayList and Vector differs in synchronization, speed and increments when the maximum size has reached.

    Explanation:

    Synchronization - ArrayList is not synchronized where as Vector is synchronized. This means when multiple threads are accessing the ArrayList it must be synchronized externally where as Vector is synchronized by default. Vectors are not thread safe where as Array List are thread safe.

    In case when the size of the array list reaches maximum it increments the size by 50% of the original size. Where as Vector size increments by 100% of the original size when the maximum it reaches the maximum length.

    As Vector is synchronized it slow compared to Array List.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “How ArrayList and Vectors are different and in what case we should use Array and in what case we should use Vectors ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers