• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused in hashcode method--

 
khushi wad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic