I\'m trying to read some really big numbers from standard input and add them together.
However, to add to BigInteger, I need to use BigInteger.valueOf(long);>
BigInteger.valueOf(long);>
According to the documentation:
BigInteger(String val) Translates the decimal String representation of a BigInteger into a BigInteger.
BigInteger(String val)
Translates the decimal String representation of a BigInteger into a BigInteger.
It means that you can use a String to initialize a BigInteger object, as shown in the following snippet:
String
BigInteger
sum = sum.add(new BigInteger(newNumber));