BingInteger(长期)在BigInteger中拥有私人访问权限

时间:2021-06-30 16:48:08

Can someone explain me why I get this error?

有人能解释我为什么会收到这个错误吗?

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

    }

3 个解决方案

#1


3  

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

构造函数BigInteger(long)仅限于私有访问并在内部使用。您可以使用

BigInteger totalIDI = BigInteger.ZERO;

#2


0  

That Constructor does not exist in the API.

API中不存在该构造函数。

See http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html

You may want to use the valueOf static method.

您可能想要使用valueOf静态方法。

#3


0  

Because that constructor is private. You have to use BigInteger.valueOf(long) instead.

因为该构造函数是私有的。你必须使用BigInteger.valueOf(long)。

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?

静态构造函数的优缺点在这里讨论静态工厂方法与实例(普通)构造函数?

#1


3  

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

构造函数BigInteger(long)仅限于私有访问并在内部使用。您可以使用

BigInteger totalIDI = BigInteger.ZERO;

#2


0  

That Constructor does not exist in the API.

API中不存在该构造函数。

See http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html

You may want to use the valueOf static method.

您可能想要使用valueOf静态方法。

#3


0  

Because that constructor is private. You have to use BigInteger.valueOf(long) instead.

因为该构造函数是私有的。你必须使用BigInteger.valueOf(long)。

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?

静态构造函数的优缺点在这里讨论静态工厂方法与实例(普通)构造函数?