Integer.parseInt()问题
public class Test
{
public static void main(String[] args)
{
String s = "7fffffff";
int n = Integer.parseInt(s,16);
System.out.println(s);
System.out.println(n);
}
}
如果把字符串s中的7改为8,9,A--F。
怎么就抛出NumberFormatException异常呢?(0--7可以)
如果字符串s的长度小于8的话,前面可以是8,9……
请问怎么回事?
谢谢 !