Java tutorial
import java.math.BigInteger; public class Main { public static void main(String[] args) { System.out.printf("%o %n", 1234); System.out.printf("%o %n", -1234); System.out.printf("%o %n", new BigInteger("1234")); System.out.printf("%o %n", new BigInteger("-1234")); System.out.printf("%x %n", 1234); System.out.printf("%x %n", -1234); System.out.printf("%x %n", new BigInteger("1234")); System.out.printf("%x %n", new BigInteger("-1234")); System.out.printf("%#o %n", 1234); System.out.printf("%#x %n", 1234); System.out.printf("%#o %n", new BigInteger("1234")); System.out.printf("%#x %n", new BigInteger("1234")); } }