You can do this with NumberFormat:
NumberFormat format = new NumberFormat();
format.setMinimumIntegerDigits(2);
System.out.println(format.format(1));
Note - String.format() is a Java 5 method.
If you're using Java 5 or above you can do:
String.format("%02d", 1);
as mentioned in other answers.