The API docs says
All of the details in the Spec concerning overflow are ignored, as BigIntegers are made as large as necessary to accommodate the r
If so why do we let some "type" overflow and some don't?
That entirely depends on how it is backed. If it's backed by for example a plain vanilla primitive int
, then it will obviously overflow at Integer.MAX_VALUE. Primitives have clear overflow borders, while those for Objects depends on how they're backed/programmed.