• Post Reply Bookmark Topic Watch Topic
  • New Topic

identityHashCode() -Reg  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I have been analysing the capabilities of System class present in java.lang package. In that class there is a method identityHashCode(Object x) the API specification says that this method will return the same hashCode which will be returned by the default hashCode() method of Object class even it has overriden version of it. But i tried and found that it only executes the overriden version not the default hashCode() value.
Can anybody share their views in this regard.
 
author
Sheriff
Posts: 23306
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to... (hmmm, flips a coin) .... the Java in General (Intermediate) forum.

Henry
[ August 11, 2006: Message edited by: Henry Wong ]
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dinesh,

Welcome to JavaRanch!

Well, if you show us the code you used to try this out, we could tell you where you went wrong. identityHashCode() doesn't call overridden hashCode() methods.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!