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!

Problem with incrementing Hex from string

807580Nov 19 2009 — edited Nov 19 2009
I am having problem incrementing a hex string below then convert it back to string.
Basically i just want to make ABCDE5AC7E112345 into ABCDE5AC7E112346. I get number format error below and not sure what i am doing wrong. some help appreciated!
String hex = "ABCDE5AC7E112345";
int value = Integer.parseInt(hex, 16);
value++;
String incHex = Integer.toHexString(value);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2009
Added on Nov 19 2009
11 comments
1,116 views