-1

Can someone explain me why I get this error?

    public BigInteger getTotalIDIDirecto(){
          BigInteger totalIDI = new BigInteger(0);
          return totalIDI;

    }
user2238244
  • 229
  • 1
  • 4
  • 13

3 Answers3

3

The constructor BigInteger(long) is limited to private access and used internally. You can use

BigInteger totalIDI = BigInteger.ZERO;
Reimeus
  • 158,255
  • 15
  • 216
  • 276
0

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.

Fildor
  • 14,510
  • 4
  • 35
  • 67
0

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?

Community
  • 1
  • 1
holap
  • 438
  • 2
  • 18