Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is Hashtable deprecating?

 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic