BigInteger class provides us operations for modular arithmetic (such as add, subtract) , prime generation , bit manipulation and many other useful operations.
Here in this example of BigInteger we have created two big integer variables and we are going to multiply them and will store that result in another BigInteger variable. Here is the full example code of BigIntegerExample.java as follows:
BigIntegerExample.java
import java.math.BigInteger;
|
Output of the above program is as follows:
| C:\biginteger>javac BigIntegerExample.java C:\biginteger>java BigIntegerExample Result is ==> 13868394935526 |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Java BigInteger example View All Comments
Post your Comment