Sunday 24 November 2013

Convert int to BigInteger in Java

Lets see how to convert the int value to BigInteger in java.

Class name:  IntToBiginteger.java

import java.util.*;
import java.math.BigInteger;

public class IntToBiginteger{
   public static void main(String[] args){
  BigInteger result = BigInteger.valueOf(5);
  System.out.println("Big int value is: " + result);
   }
}

OUTPUT:
Big int value is: 5

No comments:

Post a Comment