Tutorials Shared by the Internet Community
|Top Tutorials||New Tutorials||Submit||Login||Register|
Tutorial Basic Detail
Total Hits: 33519
Total Votes: 296 votes
Average Rating: 2.69 out of 5
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.