I think this is what you're looking for:
int a = 1;
DecimalFormat formatter = new DecimalFormat("00");
String aFormatted = formatter.format(a);
System.out.println(aFormatted);
Or, more briefly:
int a = 1;
System.out.println(new DecimalFormat("00").format(a));
An int just stores a quantity, and 01 and 1 represent the same quantity so they're stored the same way.
DecimalFormat builds a String that represents the quantity in a particular format.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…