Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String's hashCode()

800344Jun 24 2009 — edited Jun 24 2009
Dear all,
I have an unique id made of a string. I used hashCode() to covert it to int. However, I don't like an id have the negative value.
How can I convert the hashCode() I got to an unique positive number?
Regards.
Pengyou
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 22 2009
Added on Jun 24 2009
14 comments
1,257 views