Home > DeveloperSection > Forums > Vector VS ArrayList - Which has better performance and why?
Karen Green
Karen Green

Total Post:6

Posted on    October-08-2015 7:53 AM

 Java Java  Collection  Array List 

 1 Reply(s)
 362  View(s)
Rate this:
Hi , In java collection i know what is difference between ArrayList and Vector. Vectors are synchronized which will cause performance issues. So i what to know exactly what would be the performance issue if i use vectors in my application? When should we use vector instead of ArrayList?

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    October-08-2015 8:21 AM

Hi Karen,

If your program involves thread implementations, then you need to use vector instead of arrylist, which will effect your performance since all the methods in vector are synchronized which means only one thread at a time can use this method so it degrades the performance, 

But if the application doesn't involves multiple threads we need to stick with ArrayLists

Don't want to miss updates? Please click the below button!

Follow MindStick