File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between Vector and ArrayList

 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody explain the difference between Vector and ArrayList.
 
Eric Lidell
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vector is a legacy class which has been added to collections and ArrayList is a collections.
The main difference is Vector class is synchronized and Arraylist isnt.
However u can get a synchronized version of ArrayList using the static functions in Collections.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my Collections Crib Sheet drastially reduced from a Sun Tech Tip newsletter. I keep it handy rather than memorize 10 classes implementing 3 interfaces. It gives some brief tips about how to choose one collection type over another.
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Simon....what is meant by leagacy Class and Vector is synchrinized???Pls explain.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic