System.out.println(Integer.parseInt("7FFFFFFF", 16)); //this is ok.
System.out.println(Integer.parseInt("FFFFFFFF", 16)); //this throws Exception
System.out.println(Integer.valueOf("FFFFFFFF", 16)); //this throws Exception
When I try to convert hexadecimal number to integer type, negative numbers with parseInt or valueOf methods, the method throws NumberFormatException for negative numbers. I couldn't find the answer anywhere.