Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:48:04+00:00 2026-05-30T16:48:04+00:00

This is not a question about the differences between Hashtable and HashMap . I

  • 0

This is not a question about the differences between Hashtable and HashMap. I understand that a Hashtable object cannot accept null values for either key or value entries, that it is synchronized collection, and that it uses slightly less memory than a HashMap.

I’m wondering about the scenarios where it would be more appropriate to use a Hashtable instead of a HashMap.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:48:05+00:00Added an answer on May 30, 2026 at 4:48 pm

    This is not a question about the differences between Hashtable and HashMap

    Well it is really…

    I’m wondering about the scenarios where it would be more appropriate to use a Hashtable instead of a HashMap.

    Precisely when you want the differences between the two:

    • When you want to run on Java 1.1
    • When you want each operation to be synchronized (getting you a form of thread safety, so long as you never iterate over it) – and for some reason don’t want to use Collections.synchronizedMap over a HashMap
    • When you don’t want to be able to store null values
    • When the memory difference is actually significant (only after you’ve proved this is the case) – I wasn’t even aware of this difference, personally…
    • When you’re forced to by a nasty API which returns or takes Hashtable (relatively rare, fortunately)

    I can’t remember the last time I was in that situation, personally – I would say it’s vanishingly rare to be appropriate to use Hashtable in modern Java code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not yet another question about the difference between abstract classes and interfaces,
This is not a question about a specific framework. I am using plain php
This is not a question about jQuery, but about how jQuery implements such a
Disclaimer: this is not a question about how to install asp.net or an application
Please note this is not a question about online/hosted SVN services. I am working
No, this is not a question about generics. I have a Factory pattern with
This question is NOT about race-conditions, atomicity, or why you should use locks in
This question is not about which is the best, it is about which makes
This question is not about 'best' barcode library recommendation, we use various products on
This is a question not really about programming (is not specific to any language

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.