padding a string with 0 in java

Java
String.format("%05d", yournumber);
//%05 means length of 5
// 25 becomes 00025
Source

Also in Java: