Manuel Petermann wrote:You are wrong if you say == checks the references. It checks the vaulue!
In case of objects the value is the reference to the object.
Primitives have no reference they just have value.
Don't think I said anything wrong?
"The == operator compares two object references to see whether they refer to the same instance."
or
"If == is used to compare two objects then it compares the object reference and not the values."
Both are in line with my comment.
But thanks for the reply, your bit about primitives pretty much answered my question.