在java中创建一个大小为biginteger的bigInteger数组

vde*_*vid 0 java biginteger

我正在尝试制作一个大整数的大整数.

public class Polynomial4   
{  
private BigInteger[] coef;      
private BigInteger deg;   
public Polynomial4(BigInteger a,BigInteger b)   
{  
coef =  new BigInteger[b+1];// here its giving the error   
coef[b] = a; // here also its showing error *  ///required int found Biginteger  

}    

}    
Run Code Online (Sandbox Code Playgroud)

请帮帮我......先谢谢....

Per*_*ror 5

BigInteger有一个 intValue方法.它将BigInteger转换为int primitive.arrays,期望int为其大小,而BigInteger为对象.

    coef =  new BigInteger[b.intValue()+1];
       coef[b.intValue()] = a; 
Run Code Online (Sandbox Code Playgroud)