例子:
String s = String.format("%7.2f%6d%-4s", 45.556, 14, "AB");
System.out.println(s);
负号表示左对齐, 显示:_ _ 45.56_ _ _ _ 14AB_ _
, _
表示空格
System.out.printf(format, item1, item2, ..., itemk);
等价于:
System.out.print(String.format(format, item1, item2, ..., itemk));
Introduction to Java Programming 10.th, 10.10.7