Difference between ArrayList and Vector in java

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Difference between ArrayList and Vector in java

Difference between ArrayList and Vector in Java programming
http://beginnersbook.com/2013/12/difference-between-arraylist-and-vector-in-java/
  • Total Hits: 25696

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 263 votes

  • Category: JAVA/Collections

  • Submitted on: 2013-12-22 06:46:45

  • Submitted By: Chaitanya

  • Set as Favorite

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:
•API
•Synchronization
•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.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 42.97%  113
 Two starsTwo star  Vote LeftVote MiddleVote Right 7.98%  21
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 9.89%  26
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 9.51%  25
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 29.66%  78

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.





Advertisements
Advertisements