问题
i am trying to make an array of biginteger of size 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
}
}
please help me....thanks in advance....
回答1:
BigInteger has an intValue method. which converts BigInteger into an int primitive.arrays expect an int as its size while BigInteger is an object.
coef = new BigInteger[b.intValue()+1];
coef[b.intValue()] = a;
来源:https://stackoverflow.com/questions/15038754/making-an-array-of-biginteger-of-size-biginteger-in-java