摘要: 直接用代码 1 public class TestNumber { 2 3 public static void main(String[] args) { 4 float f1 = 5.4f; 5 float f2 = 5.5f; 6 //5.4四舍五入即5 7 System.out.printl 阅读全文
posted @ 2020-01-31 23:08 东功 阅读(345) 评论(0) 推荐(0)
摘要: 数字转字符串 方法一:使用String类的静态方法valueOf() 方法二:先把基本类型装箱为对象,然后调用对象的toString方法 1 public class TestNumber { 2 3 public static void main(String[] args) { 4 int i 阅读全文
posted @ 2020-01-31 23:06 东功 阅读(763) 评论(0) 推荐(0)