aspose file tools*
The moose likes Beginning Java and the fly likes What is the difference between Vector and ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is the difference between Vector and ArrayList" Watch "What is the difference between Vector and ArrayList" New topic
Author

What is the difference between Vector and ArrayList

Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Can anybody explain the difference between Vector and ArrayList.


Thanks,
Mathews
Eric Lidell
Greenhorn

Joined: Jul 02, 2003
Posts: 20
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

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
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
 
subject: What is the difference between Vector and ArrayList
 
Similar Threads
dif between vector() and ArrayList()
Question in Collection?
Vector deprecated in 1.3?
Collection
What is difference between ArrayList and vector?