Java help: To print three digit number

I have to print a number from 1 to 25 but in three digits.
like
1 as 001
2 as 002
12 as 012
20 as 020.

Here,I used

System.out.printf("%03d",i);

I want to use print function as
System.out.print( i ); But it do not give output in three digits.
Please help!

use String.format() method
e.g.

 String padded = String.format("%03d" , number);
 System.out.println(padded);

Thanks!

Is this same as in C Language?
e.g. If I have to print for decimal number.

String padded = String.format("%03f" , number);

Is this Correct?

yes, correct