Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 23590
138
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: 24220
40
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!