Parse hexadecimal string to create BigInteger in Java
Description
The following code shows how to parse hexadecimal string to create BigInteger.
Example
// ww w . j a va 2s.c o m
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
BigInteger bi = new BigInteger("120ff0", 16);
System.out.println(bi);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »