SyntaxFix
Write A Post
Hire A Developer
Questions
If you need to print the number you can use printf
System.out.printf("%02d", num);
You can use
String.format("%02d", num);
or
(num < 10 ? "0" : "") + num;
(""+(100+num)).substring(1);