class G2 {
public static void main(String[] args)
{
Short u = 127;
Short v = 127;
System.out.println(u==v);
System.out.println(u!=v);
Short u1 = 129;
Short v1 = 129;
System.out.println(u1==v1);
System.out.println(u1!=v1);
}
}
I know that when range is between -128 to 127 == operator matches content or value inside object otherwise object reference code is matched of two objects. Why this kind of implementation is there in JAVA?