0
下面的代码是用于调试:Java的BigInteger的操作
public static void main(String[] args) {
BigInteger n = new BigInteger("10000000001");
String sn = n.toString();
char[] array = sn.toCharArray();
//intend to change value of some char in array
//not standard math operation
BigInteger result = new BigInteger(array.toString());
}
它给我的错误:
Exception in thread "main" java.lang.NumberFormatException: For input string: "[[email protected]"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.math.BigInteger.<init>(BigInteger.java:316)
at java.math.BigInteger.<init>(BigInteger.java:451)
at debug.main(debug.java:14)
但它工作正常,直到这时,我不太清楚什么地方错误。
尝试打印'与Array.toString()'因为它似乎是对的BigInteger构造一个无效的输入字符串。 – effeffe
'它工作正常,直到这种情况'你能显示一些其他情况下工作正常吗? – Pshemo
我发誓它工作了一段时间..感谢您的所有努力,它也困惑我,它以某种方式它为少数输入工作... – Miranda