+ 1
How can i get this program running well
i tried to implement a getFactorial method using BigInteger but i get some compiler exceptions https://code.sololearn.com/c59YkpgVVMn7/?ref=app
2 Respuestas
+ 3
1. Import BigInteger class from math:
import java.math.BigInteger;
2. You need to return a BigInteger, because you can't convert type int to BigInteger:
return n.equals(0) ? 1 : n.multiply(...);
return n.equals(new BigInteger("0")) ? new BigInteger("1") : n.multiply(...);
+ 1
Boris Batinkov thanks alot bro...it worked