Have you ever feel that the Printf in C is very pleasant, but does not have a similar convenience in Java? Now, our Java has also begun to support the Printf () method, which is based on the variable length parameters.
For example, we can write now:
System.out.printf ("% s Has a value of% d.% N", someString, A);
How, look good? It should be noted that Java adds the% N flag to the support of the multi-platform, which is supplemented with / N.
More detailed content, reference
Java.util.Formatter's API documentation.