public class Main3 {
public static void main(String[] args) {
Integer min = Integer.MIN_VALUE;
String minHex = Integer.toHexString(Integer.MIN_VA
This seem to work for me :
public class Main3 {
public static void main(String[] args) {
Integer min = Integer.MIN_VALUE;
String minHex = Integer.toHexString(Integer.MIN_VALUE);
System.out.println(min + " " + minHex);
System.out.println((int)Long.parseLong(minHex, 16));
}
}
The integer is parsed as a "signed long" that handle such big positive number and then the sign is found back by casting it to "int".