Hello Ranchies, can anybody plz explain me the concept of == operator . i got confused...for bellow code my answer was false,true,true.... but it is returning true,true,true..... i think valueOf() returns the instance of invoking wrapper type...
The == operator is normally used to compare object references, that is, if 2 references are pointing to the same object on the object heap.
So the first result is false because they are not referring to the same object. Whereas the others are true because the contents are the same. The equals method looks at content rather than object reference.
Joined: Jul 04, 2004
So the first result is false because they are not referring to the same object