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

  • Home
  • SEARCH
  • 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 6925393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:47:02+00:00 2026-05-27T10:47:02+00:00

Could someone explain what exactly a key object is for use in hashmap? There

  • 0

Could someone explain what exactly a key object is for use in hashmap? There is a method:
“put(Object key, Object value)
Associates the specified value with the specified key in this map.”

so is the key just any object you want? And by value do they mean another object or like a attribute.
Just need some further explanation as I am confused! Thanks a bunch

  • 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-27T10:47:03+00:00Added an answer on May 27, 2026 at 10:47 am

    You should read up on what a hashmap is. In general, a hash is a data structure for efficiently storing arbitrary data (the values) in a table.

    A general problem in storing information in any structure is that of how to quickly look up the data again, once it’s in the structure. A hash solves this issue by the use of keys. The key of a value determines where in the table the value will be stored, by way of some hash function. They key is used in a hash in the same way that an index is used in an array:

    array[index] => some_value
    hash{key} => some_value
    

    In the case of “put(Object key, Object value)”, the ‘value’ object is the data that you want to store and the ‘key’ object is what you will use to get the data back out of the hash:

    MyObject myKey = new MyObject( ... );
    MyOtherObject myValue = new MyOtherObject( ... );
    ...
    myHash.put( myKey, myValue );  // add myValue to the hash
    ...
    MyOtherObject data = myhash.get( myKey );  // get myValue out of the hash
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone please explain, what exactly this O_LARGEFILE option does to support opening of
Could someone please explain the purpose of this option and what exactly it is
Could someone explain why this works in C#.NET 2.0: Nullable<DateTime> foo; if (true) foo
Could someone explain this (strange) behavior? Why is the length in the first example
Could someone explain to me what this portion of code means? repeat scroll 0
Could someone please explain what exactly recursion is (and how it works in Ruby,
Could someone please explain me what is exactly a gist feature vector of a
Could someone explain what exactly private/protected inheritance in C++ is for, and what problem(s)
Could someone please explain, I do not exactly get the concept. What is a
Could someone explain to me in simple terms the easiest way to change the

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.