Suppose you have:
int a = 3;
And I want to indicate that the number of digits is 5. So when I print it, the output is:
00003
Thank!
An int only stores the value, no formatting. To show or store leading zeros, you need to use a string.
int
System.out.println(String.format("%05d", a));