Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EXCEPT SYNCHRONIZATION what are the main diff between ArrayList and Vector  RSS feed

 
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
Sheriff
Posts: 24217
38
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
Posts: 21048
85
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
Boost this thread!