String格式化输出:
使用String类format()
1:数字前面补全0
String.format("%04d",88) 输出:0088
2:左对齐
System.out.printf("|%-4d|",88) 输出:|88 |
String格式化输出:
使用String类format()
1:数字前面补全0
String.format("%04d",88) 输出:0088
2:左对齐
System.out.printf("|%-4d|",88) 输出:|88 |