📖 Java 参考手册📁Java 数学方法📄Java round() 方法本页总览Java Math round() 方法 round() 方法将指定值四舍五入到最接近的整数或长整数并返回。也就是说,3.87 四舍五入为 4,3.24 四舍五入为 3。 示例 class Main { public static void main(String[] args) { double a = 3.87; System.out.println(Math.round(a)); }}// 输出:4 Math.round() 的语法