• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hashcode

 
anita dhar
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am very confused with hashcode() can any one explain in the proper way this concept with a example
 
Charandeep Singh
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anea

i am very confused with hashcode() can any one explain in the proper way this concept with a example

The main thing to understand related to hashcode is like
if you have 10 objects which are of same type with different weights and you have 10 bags each of different colour
so just to make things easier for yourself what you will do you will place each object in different bag and recognize them with the colour of the bag
same way you use hascode() to have each element a unique identity so that it becomes easier to fetch each object .
That is why we say that the when each element has a unique hashCode() the efficent is the implmentation of that HashMap().

Be more specific in your problem may then may be we are able to provide you better understanding .

All the best
 
anita dhar
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks , i understood the this , can you tell me in some brief its implementation what is means to override the hshcode() can you give any simple example of this
thanks
 
Charandeep Singh
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anea
go thru this
web pagelink
Might be it clears your air for hashcode()
 
anita dhar
Ranch Hand
Posts: 69
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i will go through this link and will be back with my queries
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic