62,623
社区成员
发帖
与我相关
我的任务
分享
//格式 [argument_index$][flags][width][.precision]conversion
//还可以写成
System.out.format("%4d%,20.2f\n",year,amount);
//或
System.out.print(String.format("%4d%,20.2f\n",year,amount));
//或
System.out.println(String.format("%4d%,20.2f\n",year,amount));
System.out.format("%4d%,20.2f\n",year,amount);
//或
System.out.format(String.format("%4d%,20.2f\n",year,amount));