Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What are the differences between ArrayList and Vector? What should I use?

arraylist differences vector
0
Posted

What are the differences between ArrayList and Vector? What should I use?

0

HashMap and ArrayList have basically replaced their synchronized brother HashTable and Vector. HashTable and Vector are about 3 times slower. If you think it is safer to use HashTable and Vector, think twice, that synchronization only on the atomic operation based, they usually give you a fake safe feeling, which might make your code less safe. Use HashMap and ArrayList unless your boss commands you otherwise. Or what you are doing is extremely security sensitive, the security should be obtained at any price. In that case, I still don’t think you will go to sleep soundly because you are using Vector or HashTable.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.