Difference between ArrayList and Vector in java
|Top Tutorials||New Tutorials||Submit||Login||Register|
Total Hits: 21789
Total Votes: 241 votes
Submitted on: 2013-12-22 06:46:45
Submitted By: Chaitanya
Description:This is the most frequently asked interview question. Sometimes Vector is better; sometimes ArrayList is better; sometimes you don't want to use either. There are four factors to consider when there is choice between ArrayList and Vector. Based on these factors we can identify which is the most suitable collection that suits the requirement: The factors are:
Vector is not synchornized while ArrayList is synchronized so if there is a need to perform thread-safe operations Vector can be used.
In this tutorial we will see many other differeneces between these classes along with the way to synchronize the ArrayList explicitly. More detail...