Numbers do not have significant leading zeros. (Never mind that the code actually uses an octal number literal in Java.)
See String.format
and the Format Syntax. In particular, '0' flag, width modifier, and the 'd' (decimal integer) conversion are useful here.
for(int i=1; i<3; i++){
// % - start of format
// 0 - 0-pad the result
// 7 - set result width to 7 characters wide
// d - display as decimal integer
String id = String.format("ABC%07d", i);
System.out.println(id);
}