wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 24166
    
  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: 19541
    
  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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector
 
Similar Threads
Synchronization
Vector deprecated in 1.3?
Diff between Vector and ArrayList(implementation Diff)
vector and arraylist
What is the difference between ArrayList and Vector?