Shared Tutorials

Tutorials Shared by the Internet Community


  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Basic Detail

Difference between ArrayList and Vector in java

Difference between ArrayList and Vector in Java programming


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:
•Data growth
•Usage patterns

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.

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 44.93%  133
 Two starsTwo star  Vote LeftVote MiddleVote Right 7.43%  22
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 9.8%  29
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 9.46%  28
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.38%  84

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.