VECTOR VS ARRAYLIST - WHICH HAS BETTER PERFORMANCE AND WHY?

Karen Green

Total Post:6

Points:42
Posted by  Karen Green
 714  View(s)
Ratings:
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?
  1. Mayank Tripathi

    Post:397

    Points:3117
    Re: Vector VS ArrayList - Which has better performance and why?

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!