File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Doubt in Hash Map and Hash Table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Doubt in Hash Map and Hash Table" Watch "Doubt in Hash Map and Hash Table" New topic
Author

Doubt in Hash Map and Hash Table

Prasad Chelur
Greenhorn

Joined: Feb 12, 2002
Posts: 10
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?


prasadcts
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

The Hashtable is thread-safe, and if you want to make HashMap threadsafe, you can use -

Or you can obtain a lock on hashmap object as and when you require it for a synchronized block.
HTH,
- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Hash Map and Hash Table
 
Similar Threads
Collections
what does it mean that hashtable is synchronized and hashmaps are not?
which methods of vector and Hash table are synchronized?
Hash Table - Sychronization
Can we use Hashtable or Vector in a JSP page?