Search code examples
javaprivatebiginteger

BingInteger(long) has private acces in BigInteger


Can someone explain me why I get this error?

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

    }

Solution

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

    BigInteger totalIDI = BigInteger.ZERO;