使用 Math 类操作数据
Math 类位于 java.lang 包中,包含用于执行基本数学运算的方法, Math 类的所有方法都是静态方法,所以使用该类中的方法时,可以直接使用类名.方法名,如: Math.round();
常用的方法:

通过案例我们来认识一下他们的使用吧!!

运行结果:

PS: Math 类还提供了许多其他方法。
使用 Math 类操作数据
Math 类位于 java.lang 包中,包含用于执行基本数学运算的方法, Math 类的所有方法都是静态方法,所以使用该类中的方法时,可以直接使用类名.方法名,如: Math.round();
常用的方法:
通过案例我们来认识一下他们的使用吧!!
运行结果:
PS: Math 类还提供了许多其他方法。
本文标题:Java中 使用 Math 类操作数据
本文链接:https://www.haomeiwen.com/subject/qvwzittx.html
网友评论