我需要一个最多20位的大数字,我正在使用bigint . 它给了我这个错误(二元运算符的坏操作数类型)在线下面 .
BigInteger t = new BigInteger(my_number.getText().toString()); my_number.setText(String.valueOf(t+1));
Java不支持运算符重载 . 使用 add 方法: t.add(BigInteger.ONE)
add
t.add(BigInteger.ONE)
BigInteger bi = new BigInteger("12223"); BigInteger cvk = new BigInteger("1"); System.out.println(String.valueOf(bi.add(cvk)));
希望我的帮助有效 .
2 回答
Java不支持运算符重载 . 使用
add
方法:t.add(BigInteger.ONE)
希望我的帮助有效 .