Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

Java BigInteger example

BigInteger class provides us operations for modular arithmetic (such as add, subtract) , prime generation , bit manipulation and many other useful operations.

Java BigInteger example

                         

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;
public class BigIntegerExample 
{
    public static void main(String[] args
    {
        BigInteger bigInteger1 = new BigInteger ("123456789");
        BigInteger bigInteger2 = new BigInteger ("112334");
        BigInteger bigIntResult =
          bigInteger1.multiply
(bigInteger2)
        System.out.println("Result is  ==> " + bigIntResult);
    }
}

Output of the above program is as follows:

C:\biginteger>javac BigIntegerExample.java

C:\biginteger>java BigIntegerExample
Result is ==> 13868394935526

Download Source Code

                         

» View all related tutorials
Related Tags: c string data convert integer variable type vi rsa int ria biginteger long to bi e il can var pe

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.