Create BigInteger via long type variable in Java
Description
The following code shows how to create BigInteger via long type variable.
Example
/*from w w w . ja v a 2s . c om*/
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
BigInteger bi2 = BigInteger.valueOf(123L);
System.out.println(bi2);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »