Parse and Format a Big Integer into octal in Java
Description
The following code shows how to parse and Format a Big Integer into octal.
Example
/* w w w . j a v a 2 s.c o m*/
import java.math.BigInteger;
public class Main {
public static void main(String[] argv) throws Exception {
BigInteger bi = new BigInteger("1000", 8);
String s = bi.toString(8);
System.out.println(s);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »