1.String.format(String format,Object… args) Java中用String.format()来控制输出精度, format参数用来设置精度格式, args参数代表待格式化的数字. 返回值是格式化后的字符串. Java API文档中的解释是这样的: 文档不好懂… 没关系 直接上代码! //精确到小数点后两位: public class test { public static void main(String args[]) { //格式控制与C语言类似 S…