$ 0 0 int x = 1; System.out.format("%05d",x); if you want to print the formatted text directly onto the screen.