aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Confused in hashcode method-- Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Confused in hashcode method--" Watch "Confused in hashcode method--" New topic
Author

Confused in hashcode method--

khushi wad
Greenhorn

Joined: Jul 13, 2005
Posts: 2
According to one of wiz lab example

Even the state of object does not change, it is perfectly legal that the hash code returned by it may not remain consistent from one execution of an application to another execution of an application of the same application.

as per my knowledge hash code should be always same..... completely confused have exam on monday.... highly appriciate quik responses.

Thanks
newgen pras
Ranch Hand

Joined: Jun 01, 2005
Posts: 34
hi

Yes.... the hashcode will remain same for any number of calls with in a single execution ...I hope u got confussed here only .. With that execution it will remain same ..

If that program is executed second time the hash code need not be same as what we obtained in first excution but it will remain same through out the second execution ... hope this helps ...

Prasanna
newgen pras
Ranch Hand

Joined: Jun 01, 2005
Posts: 34
Hi find the Example code for this ...

See the hashcode value i got may be different from what u get ..but the if condition will always remain true..

Prasanna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confused in hashcode method--