Originally posted by Keith Lynn:
Notice that b3 is a primitive. When you use the == between a Wrapper and a primitive, the wrapper is unboxed.
Based on your reply then the following line should also return (true) since b1 will be un-boxed and b4 is already a primitive. But the question official answer says that this will return false....so why is this?
System.out.println(b1 == b4);
and if the above line returned false then the line
System.out.println(b1==b3);
should also return false! but that was not the case as it returned true!
I am confused here about this issue, so do you have any idea about the conflict in the above 2 lines?
Thanks in advance