import java.lang.*;
class EqualityChk
{
public static void main(
String[] args)
{
Integer k=127;// line 1
Integer g=127;//line 2
if(k==g)
System.out.println(" K AND G ARE EQUAL ");
else
System.out.println(" NOT EQUAL ");
}
}
Hi all
The output of the above program is
K AND G ARE EQUAL
But if I modify line 1 and line 2 and change there values to 128
the output changes to NOT EQUAL can any body tell me what is the exact reason for this inconsistency?
Thanks
Charandeep