How do I convert a String to a BigInteger?

前端 未结 6 1403
自闭症患者
自闭症患者 2020-11-30 08:09

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);

6条回答
  •  春和景丽
    2020-11-30 08:49

    Using the constructor

    BigInteger(String val)

    Translates the decimal String representation of a BigInteger into a BigInteger.

    Javadoc

提交回复
热议问题