How to create a very large BigInteger
问题 I need to add two very big integers 46376937677490009712648124896970078050417018260538 + 37107287533902102798797998220837590246510135740250; What's wrong with this? BigInteger f = 37107287533902102798797998220837590246510135740250; How I can solve this problem in Java using BigInteger ? 回答1: The problem here is that 3710... will be interpreted as an int , and so it will be out of range. Essentially what you're trying to do is to create an int , and then convert it to a BigInteger , and the