public class Main {
public static void main(String[] args) {
int number = 2;
System.out.println(String.format("%04d", number));
// 0 - declares padding between the zeroes
// 4 - declares the width of the string
}
}