Integer v1_1 = 127;
Integer v1_2 = 127;
Integer v2_1 = 128;
Integer v2_2 = 128;
System.out.println(v1_1 == v1_2);//true
System.out.println(v2_1 == v2_2);//false
Run Code Online (Sandbox Code Playgroud)
为什么第二个表达是假的?
我无法弄清楚价值如何影响比较结果.
| 归档时间: |
|
| 查看次数: |
420 次 |
| 最近记录: |