posted 13 years ago
int i1 = -123;
System.out.printf(">%1$(7d< \n", i1);
printf("format string", argument(s));
%[arg_index$][flags][width][.precision]conversion char
The formatting data always start with the % sign.
1$ - represents the first argument that should be printed
() - enclose negative numbers in parentheses
7d - means that the string will have the width of 7 integers
\n - escape character new line
Hope that this will help you.