I guess this is what you're looking for:
- Integer.toHexString(int x);
Regards,
Rok
SCJP, SCWCD
Adithya:
Then you'll need to store it as a String. Storing (base 10) 255 is no different than (base 16) 0xFF to
Java
. You can use Rok's suggestion and do something like this:
John.
But this doesn't store hex value in int,it stores in string.
Then how come this following code is valid???
Adithya:
As I was trying to explain to you, to Java there is
no difference
between these statements:
You can already store hex values as ints (and use Integer.toHexString() to display as a hex String). Java doesn't store any 'formatting' in primitives.
John.
current ranch time (not your local time) is
Sep 10, 2024 06:56:56