Ask Question

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

+4
Answers (1)
  1. 9 January, 20:34
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers