class D {
public static void main(String args[]) {
Integer b2=128;
Integer b3=128;
System.out.println(b2==b3);
}
}
Using primitive data types, ints, would produce true in both cases, the expected output.
However, since you're using Integer objects the == operator has a different meaning.
In the context of objects, == checks to see if the variables refer to the same object reference.
To compare the value of the objects you should use the equals() method E.g.
b2.equals(b1)
which will indicate whether b2 is less than b1, greater than, or equal to (check the API for details)