1.String.format()字符串常规类型格式化的两种重载方式
format(String format, Object… args) 新字符串使用本地语言环境,制定字符串格式和参数生成格式化的新字符串。
format(Locale locale, String format, Object… args) 使用指定的语言环境,制定字符串格式和参数生成格式化的字符串。
例如:
String str = String.format(“%04d”, 99);
System.out.printf(str);
//结果:0099;