posted 17 years ago
Howdy!
When you compare two distinct objects with == the result will be always false.
When you compare two primitives, it will be true when the value is the same or false if not.
When you compare an object of a wrapper class with a corresponding primitive, the object will be unboxed and the comparison will be as if both are primitives.
If the wrappers are of type Byte, Short, Character or Integer the story is a bit more complicated, but this is not part of the question.
Note that in the line with b4 a new object is created, just as in the first two lines, only with a different syntax (autoboxing).
Yours,
Bu.
all events occur in real time