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!

Formatting Hex

807589Sep 13 2008 — edited Sep 14 2008
I've been looking for a way to format a hex number. Im doing something like this
int startAddress = 0x00491d10;

System.out.print("\n0x" + Integer.toHexString(startAddress));
but it prints out "0x491d10" instead of "0x00491d10". Any easy way to fix this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2008
Added on Sep 13 2008
10 comments
797 views