Ask Question
8 July, 22:10

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

+1
Answers (1)
  1. 9 July, 01:44
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers