public class Try { public static void main(String []args) { Try try1=new Try(); System.out.println(try1.add1(1,2.1)); System.out.println(try1.add2(1,3.1)); } public float add1(int a, float……
引用 4 楼 q445697127 的回复: 引用 3 楼 abc41106 的回复: 为什么我编译通过了? 楼主是怎么编译的?+1 +1 我被楼主坑了!!! 我怀疑他编译的东西,和他在这里写的肯定不同
float转int精度会丢失,所以强制将int转float
引用 3 楼 abc41106 的回复: 为什么我编译通过了? 楼主是怎么编译的?+1
为什么我编译通过了? 楼主是怎么编译的?
62,634
社区成员
307,269
社区内容
加载中
试试用AI创作助手写篇文章吧