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 6030517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:02:53+00:00 2026-05-23T05:02:53+00:00

I am preparing for software interviews and i am stuck with a question for

  • 0

I am preparing for software interviews and i am stuck with a question for days now.

I have not been able to figure out the difference between linkedhashmap, map, hashtable, hashmap present in the Java Collection API.

Do all of these have the same get and put complexities? I know that map is the interface class
and hashmap, hashtable, linkedhashmap implement this interface. So does that mean that the inner implementation of these 3 classes is the same? How are they implemented in the collections api?

Thanks in Advance!!!

  • 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-23T05:02:54+00:00Added an answer on May 23, 2026 at 5:02 am

    I doubt the differences can be explained significantly better than what’s already written in the JavaDocs for these classes:

    • Map is the basic interface common to all these classes
    • a Hashtable is one implementation of that interface, for the “old” days when it was thought that having everything synchronized is a good idea (ref. Vector). It offers “kind of” thread-safety, if you know what you are doing. If you are serious about a map which can be used from multiple threads you should absolutely check out the ConcurrentHashMap and ConcurrentSkipListMap.
    • a HashMap is almost the same as a Hashtable, but with the synchronization removed. It’s the preferred general-purpose Map implementation.
    • a LinkedHashMap additionally maintains a linked list of it’s entries, which allows to maintain an ordering or use it as a LRU cache easily, just read the JavaDoc.

    All of the aforementioned Map implementations have their basic get/put operations in (amortized) O(1) time complexity. There are minor differences in the handling of null values, it’s inevitable to check the JavaDoc for details.

    To get an idea of how these classes are implemeted, have a look at their inheritance tree:

    • Map (just the interface)
      • Dictionary (obsoleted abstract class)
        • Hashtable (the “old” map implementation lives on it’s own)
      • AbstractMap (the basic functionality of the “new” map implementations)
        • HashMap (the first concrete map implementation for general purpose use)
          • LinkedHashMap (extends HashMap by mainaining the linked list)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Preparing for exam and got stuck at this question: Allowed operators are <<,+,& no
Pros and cons and Usage I have been preparing myself for an interview for
I've been preparing to deliver a presentation on SQL Server Compact Edition 3.5 (SP1
I'm currently preparing for an interview, and it reminded me of a question I
I'm preparing for a quiz, and I have a strong suspicion I may be
I'm preparing to the SQL Server exam (70-431). I have the book from Sybex
I have been creating a website with Ruby on Rails, and will be hosting
Im preparing website page structure but stuck here Html <div id=main> <div id=left></div> <div
I'm preparing to do an .NET exam and I came across this question. I
I'm preparing my paypal system and have a separate page that forwards the user

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.