Error assigning to an an element in an array of BigInteger

前端 未结 4 548
小蘑菇
小蘑菇 2021-01-24 21:42

This is my code. It shows an error when I create an array of BigInteger and try to assign a value.

package test;
import java.math.*;
import java.la         


        
4条回答
  •  旧巷少年郎
    2021-01-24 22:20

    Java have static types and the auto boxing is only enabled for the wrappers of primitive types, like int to Integer, but not for BigInteger. You will have to do

    new BigInteger("676557656534345345654645654654645645645645665656567") 
    

    explicitly.

提交回复
热议问题