Tuesday, January 29, 2008 04:10 PM
One has to understand what it means when you do a ==
You are looking at the value that is in that memory location. In the case of a primitive, the value in that memory location is the value of the primitive. However, in the case of an object, you are looking at a pointer to the object. When you do an == on an object, you are determining if the pointer to the object is the same. If not, then you are not looking at the same object.
Hope this helps.