Reputation: 835
I need a large number up to 20 digits and I'm using bigint. It gives me this error(bad operand types for binary operator +) on line below.
BigInteger t = new BigInteger(my_number.getText().toString());
my_number.setText(String.valueOf(t+1));
Upvotes: 0
Views: 3999
Reputation: 761
BigInteger bi = new BigInteger("12223");
BigInteger cvk = new BigInteger("1");
System.out.println(String.valueOf(bi.add(cvk)));
Hope my help works thanks.
Upvotes: 1
Reputation: 27525
Java does not support operators overloading. Use add
method: t.add(BigInteger.ONE)
Upvotes: 6