File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Is Hashtable deprecating? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Is Hashtable deprecating?" Watch "Is Hashtable deprecating?" New topic
Author

Is Hashtable deprecating?

Anna Hays
Ranch Hand

Joined: Nov 09, 2003
Posts: 131
I think I heard/read that Hashtable is deprecating, it is true??
I want to use Hashtable for 2 purposes in my Data class
1. its synchronized methods
2. keeping value pairs
I can't use Vector for that because I am using recNo as a key to keep the lockCookie. Vector will just have millions of elements if there are millions of records. I can't find any thing else except Hashtable.
Thanks for any suggestions!
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Anna,
Originally posted by Anna Kafei:
I think I heard/read that Hashtable is deprecating, it is true??
I want to use Hashtable for 2 purposes in my Data class
1. its synchronized methods
2. keeping value pairs
I can't use Vector for that because I am using recNo as a key to keep the lockCookie. Vector will just have millions of elements if there are millions of records. I can't find any thing else except Hashtable.

As far as I know Hashtable is not deprecated (although it may be some time in the future). I think you can still use it. However, if you want to modernize you can look at HashMap, and if you need synchronized methods you could investigate the synchronizedCollection method in the java.util.Collections class.
Hope this helps,
George


Regards, George
SCJP, SCJD, SCWCD, SCBCD
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Is Hashtable deprecating?
 
Similar Threads
Hashtable elements to vector
Enumeration vs Iterator
Collection
looping though and change the int value
Add Hastable obj to a Vector?