格式化输出的两种方式


详细见链接:

https://www.cnblogs.com/hq233/p/6539107.html

DecimalFormat format = newDecimalFormat(“00000”);

System.out.println(format.format(123));   //00123


详细见链接:

http://blog.sina.com.cn/s/blog_5ac88b350100auna.html

System. out.printf(“%05d”,12);//0001

猜你喜欢

转载自blog.csdn.net/l903445981/article/details/79943163