Integer.parseInt("ff8ca87c", 16);
这给了我一个NumberFormatException出于某种原因。你知道这是为什么吗?为什么此Java parseInt十六进制字符串导致NumberFormatException?
Exception in thread "main" java.lang.NumberFormatException: For input string: "ff8ca87c"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.valueOf(Unknown Source)
你试过0xff8ca87c了吗? – John3136 2012-02-08 09:33:38
@ John3136是的,它也不起作用 – Ignoreme 2012-02-08 09:34:34
@ John3136 - 该规范根本没有提到“0x”前缀。 – Polynomial 2012-02-08 09:34:58