int stringLength = 4; public String fillWithLeadingZeroes(int arg0) { //need to determine the length of the int int length = Integer.toString(arg0).length; return ... //insert as many zeroes as neccessary to have same length has stringLength IF length is not stringLength. } example: arg0=34 returns 0034 arg0=23456 returns 23456 arg0=1234 returns 1234