写出下面二题的输出结果。PS:不考上机,考笔试啊。
1、
Integer i1=100;
Integer i2=100;
if(i1==i2)
   sys("i1==i2");
else
   sys("i1!=i2");
2、
Integer i1=200;
Integer i2=200;
if(i1==i2)
   sys("i1==i2");
else
   sys("i1!=i2");

解决方案 »

  1.   

    1,i1 == i2
    2,i1 != i2详见 http://topic.csdn.net/u/20080130/17/7fdd8b93-bdd6-467a-863e-fc3c9731bc52.html  68 楼的回复。
      

  2.   

    原来这么回事:
    If the value p being boxed is true, false, a byte, a char in the range 
    \u0000 to \u007f, or an int or short number between -128 and 127, then
    let r1 and r2 be the results of any two boxing conversions of p. It is
    always the case that r1 == r2.
      

  3.   


    楼主是 CSDN 第 ++N 遍问此问题的。
      

  4.   

    真神奇!!还能这样,自认为懂java,看来离大门还远着呢,更别说一窥究竟了,唉~~~~~~~~~~~~~~~~