A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
Other JSE/JEE APIs
Doubt in Hash Map and Hash Table
Joined: Feb 12, 2002
May 26, 2003 04:54:00
I knew Hash table is synchronized and Hash Map is not synchronized.
my question which method in Hash Table is sychronized.
Is there any way that we can make Hash Map synchronized.If yes how?
Joined: Sep 22, 2001
May 26, 2003 05:09:00
The Hashtable is thread-safe, and if you want to make
threadsafe, you can use -
Map m = Collections.synchronizedMap(new HashMap(...)); //from the API DOCs
Or you can obtain a lock on hashmap object as and when you require it for a synchronized block.
I agree. Here's the link:
subject: Doubt in Hash Map and Hash Table
Hash Table - Sychronization
Can we use Hashtable or Vector in a JSP page?
which methods of vector and Hash table are synchronized?
what does it mean that hashtable is synchronized and hashmaps are not?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014