This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes difference between vector and array list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "difference between vector and array list" Watch "difference between vector and array list" New topic
Author

difference between vector and array list

vidhyasagar reddy
Ranch Hand

Joined: Jul 05, 2005
Posts: 40
Hai every body

vector is synchronized and arraylist is not synchronized

can any body explain me what happens we use the vector and arraylist in the servlet.
will it produce the same o/p
or not?
if possible provide me sample code
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24189
    
  34

ArrayList is a replacement for Vector. Never use Vector in new code -- only use it when needed to interface with existing code that works with Vector.

I'm going to move this to Java in General (Beginner) for further discussion.


[Jess in Action][AskingGoodQuestions]
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
When should I use java.util.Vector/java.util.Hashtable?
http://jqa.tmorris.net/GetQAndA.action?qids=53&showAnswers=true


Tony Morris
Java Q&A (FAQ, Trivia)
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: difference between vector and array list
 
jQuery in Action, 3rd edition