public class Main3 {
public static void main(String[] args) {
Integer min = Integer.MIN_VALUE;
String minHex = Integer.toHexString(Integer.MIN_VA
According the the documentation, toHexString returns "a string representation of the integer argument as an unsigned integer in base 16. "
So the correct reverse operation is probably Integer.parseUnsignedInt that was introduced as part of Java 8:
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(Integer.parseUnsignedInt(minHex, 16));
}