Java examples for Language Basics:Number Format
Using the integer conversion characters.
public class Main { public static void main(String[] args) {/*from w w w . j a v a 2 s . com*/ System.out.printf("%d\n", 26); System.out.printf("%d\n", +26); System.out.printf("%d\n", -26); System.out.printf("%o\n", 26); System.out.printf("%x\n", 26); System.out.printf("%X\n", 26); } }