File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes which code is hashcode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "which code is hashcode" Watch "which code is hashcode" New topic
Author

which code is hashcode

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689


hi, here i am displaying a hashcode in three ways but which is the actual hashcode here
please sombody tell me the actual hashcode...
thanks in advance


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
All the above call the default hashCode method in your Object class. If you need to provide your own hashCode method then it should be an instance method with no argument as shown below:





If you override the hashCode() method remember to override equals() method as well. If 2 objects are equal, then they should produce the same hashcode but the reverse is not true.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which code is hashcode