0

I'm trying to compare 4 values in a program.

Long val1 = 127l;
Long val2 = 127l;
Long val3 = 128l;
Long val4 = 128l;
Log.e("XXXX",(val1==val2)+" "+(val3==val4));

This gives me val1l == val2l is true and val3' == val4l is false. What is the reason behind this output. I think it's coming because of the wrapper class. Please help me to clear this.

codebot
  • 2,540
  • 3
  • 38
  • 89

0 Answers0