Create BigInteger via string in Java
Description
The following code shows how to create BigInteger via string.
Example
// w w w . j a v a 2s . com
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
// Create via a string
BigInteger bi1 = new BigInteger("1234567890123456890");
System.out.println(bi1);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »