Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving the value from bucket..!!

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How will you retreive if two different objects have same hashcode?


 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral Saxena wrote:How will you retreive if two different objects have same hashcode?


It depends on the implementation.

It took me about 5 seconds with google to find this: http://en.wikipedia.org/wiki/Hashtable

Please spend more time and effort researching before posting questions.
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral Saxena wrote:How will you retreive if two different objects have same hashcode?



Please TellTheDetails. Retrieve from where? HashMap? Hashtable? HashSet? or anything else?

Also, have you heard about equals method?
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anayonkar Shivalkar wrote:
Saral Saxena wrote:How will you retreive if two different objects have same hashcode?



Please TellTheDetails. Retrieve from where? HashMap? Hashtable? HashSet? or anything else?

Also, have you heard about equals method?


from HashMap..!!
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral, I think it will be useful to you if you understand the hashCode() contract. Also, please take a look at the equals contract.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic