经典指数          
原因
1359
浏览数
0
收藏数
 

以下代码为什么会输出这种结果? public static void main(String[] args) {         System.out.println(2.0 - 1.1);         System.out.println(1.0 - 0.1);  } 输出结果: 0.899999999999999 0.9

     举报   纠错  
 
切换
2 个答案

有些面试狗喜欢问这种所谓Java基础问题

 
切换

输出函数参数只能是输出String字符串参数或者其他能够转化为字符串的类型

 
切换
撰写答案