Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector

 
Mortin kim
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector..?

and HashTable and HashMap..?


Thanks
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Rupali Sarolkar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20550
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hashtable does not allow null as key or value, HashMap does.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic