int input = 42;
System.out.print("Prefixed with necessary zeroes to make output length a total of 8 characters, including the positive sign: " + String.format("%+08d
", input)); // This will print +0000042
System.out.print("Octal output: " + String.format("%o
", input)); // This will print 52
System.out.print("Hex output: " + String.format("%x
", input)); // This will print 2a