I have the following code...
int Val=-32768; String Hex=Integer.toHexString(Val);
This equates to ffff8000
ffff8000
int
Below code would work:
int a=-32768; String a1=Integer.toHexString(a); int parsedResult=(int)Long.parseLong(a1,16); System.out.println("Parsed Value is " +parsedResult);