floor返回不大于的最大整数。round则是4舍5入的计算,入的时候是到大于它的整数。round表示"四舍五入",算法为Math.floor(x+0.5),即将原来的数字加上0.5后再向下取整,所以Math.round(11.5)的结果为12,Math.round(-11.5)的结果为-11。我们先通过以下实例来看看JavaMathfloor、ceil、rint及round各个方法的输出结果:Test.javaimportjava.util.Scanner;publicclassTest{publicstaticvoidmain(String[]args){Scannersc=newScan