Can someone explain me why I get this error?
public BigInteger getTotalIDIDirecto(){
BigInteger totalIDI = new BigInteger(0);
return totalIDI;
}
Can someone explain me why I get this error?
public BigInteger getTotalIDIDirecto(){
BigInteger totalIDI = new BigInteger(0);
return totalIDI;
}
The constructor BigInteger(long)
is limited to private
access and used internally. You can use
BigInteger totalIDI = BigInteger.ZERO;
That Constructor does not exist in the API.
See http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
You may want to use the valueOf static method.
Because that constructor is private. You have to use BigInteger.valueOf(long)
instead.
http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html#valueOf(long)
Pro and cons of static constructor are discussed here Static factory methods vs Instance (normal) constructors?