can you increase the hex value in java? that is, "hexadecimal value" = "hexadecimal value" ++
It depends on how the hex value is stored. If you have a hexadecimal value in a string, convert it to Integer, increase and convert it.
int value = Integer.parseInt(hex, 16); value++; String incHex = Integer.toHexString(value);
What does "hexadecimal value" mean? What type of data is your value stored in?
Note that int / short / char / ... doesn't care how your value was originally represented:
int i1 = 0x10; int i2 = 16;
i1 i2 . Java ( ) /.
i1
i2
: .
myHexValue++;
. , " " . ( )
Integer.toHexString( myHexValue )
Integer.parseInt( someHexString, 16 );
.
. ints , , .
int hex = 0xff; hex++; // hex is now 0x100, or 256 int hex2 = 255; hex2++; // hex2 is now 256, or 0x100
- . . , . , , " ?".