脚本宝典收集整理的这篇文章主要介绍了一些工具类,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
代码1
/* java 语言中线程共有六种状态,分别是: NEW(初始化状态) RUNNABLE(可运行 / 运行状态) BLOCKED(阻塞状态) WaiTING(无时限等待) TIMED_WAITING(有时限等待) TERMINATED(终止状态) */ public class Demo1 { public static void main(String[] args) { System.out.PRintln("Math.abs(-10) = " + Math.abs(-10)); System.out.println("Math.ceil(3.14) = " + Math.ceil(3.14)); System.out.println("Math.floor(9.8) = " + Math.floor(9.8)); System.out.println("Math.random() = " + Math.random()); System.out.println("Math.pow(2,4) = " + Math.pow(2, 4)); System.out.println("Math.sqrt(9) = " + Math.sqrt(9)); System.out.println("Math.round(3.14) = " + Math.round(3.14)); System.out.println("Math.round(3.4) = " + Math.round(3.4)); System.out.println("Math.round(3.5) = " + Math.round(3.5)); System.out.println("Math.PI = " + Math.PI); } }
输出结果
Math.abs(-10) = 10 Math.ceil(3.14) = 4.0 Math.floor(9.8) = 9.0 Math.random() = 0.8814462121707075 Math.pow(2,4) = 16.0 Math.sqrt(9) = 3.0 Math.round(3.14) = 3 Math.round(3.4) = 3 Math.round(3.5) = 4 Math.PI = 3.141592653589793 Process finished with exit code 0
代码2
以上是脚本宝典为你收集整理的一些工具类全部内容,希望文章能够帮你解决一些工具类所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。