FileDocCategorySizeDatePackage
IntegerFormatExample.javaAPI DocExample356Sun Feb 05 16:56:46 GMT 2006None

IntegerFormatExample.java

public class IntegerFormatExample {

    public static void main(String[] args) {
        int n = 1023;
        System.out.printf("Decimal:               %d\n", n);
        System.out.printf("Octal:                 %o\n", n);
        System.out.printf("Lowercase hexadecimal: %x\n", n);
        System.out.printf("Uppercase hexadecimal: %X\n", n);
    }
}