摘要: 运算符 1.算术运算符 arithmetic:算术 除法 / 的使用 看一段代码: System.out.println(10 / 4); //输出为2 因为是两个整数相除,所以结果默认用整数来接收 System.out.println(10.0 / 4);//输出为2.5 double d = 1 阅读全文
posted @ 2021-12-04 05:53 紫英626 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 程序中 +号 的使用 当左右都是数值类型时,做加法运算 当左右有一个为字符串时,做拼接运算 运算顺序为从左到右 System.out.println(100+3);//103 System.out.println("100"+3);//1003 System.out.println(100+3+"h 阅读全文
posted @ 2021-12-04 00:34 紫英626 阅读(48) 评论(0) 推荐(0) 编辑

紫英