This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector" Watch "EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector" New topic
Author

EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector

Mortin kim
Ranch Hand

Joined: Nov 15, 2007
Posts: 44
EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector..?

and HashTable and HashMap..?


Thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

You tell us what the differences are, and we'll tell you which ones are the main ones (start by reading the Javadocs for each class.)


[Jess in Action][AskingGoodQuestions]
Rupali Sarolkar
Greenhorn

Joined: Nov 20, 2007
Posts: 13
I think Synchronization (i.e. Thread safety) is the main difference. Because of which one more thing comes into picture that is "speed(or performance)" of the operations on these collection objects.

When you know that there will not be multiple threads accesing the collection object you should use the ArrayList instead of vector.

-Rupali
SCJP , SCWCD.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19557
    
  16

Hashtable does not allow null as key or value, HashMap does.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector
 
Similar Threads
Synchronization
Diff between Vector and ArrayList(implementation Diff)
Vector deprecated in 1.3?
What is the difference between ArrayList and Vector?
vector and arraylist