Here on calling b.toString() in b1.toString() == b1.toString() we get two different String object because call to toString() is done at run time.so == should result in false.Please correct me iff i am wrong [ September 28, 2005: Message edited by: agrah upadhyay ]
<i>--Agrah Upadhyay--</i><br />Final Year B.Tech SCJP,SCWCD,SCBCD <br /> <br /><b>Now since the real test for any choice is having to make the same choice again,knowing full well what it might cost.</b>-Oracle
Joined: Sep 01, 2005
Haa Haa Haa With above posting i have completed my 101 posts
yes! you are using only one reference b; However keep in mind b.toString() returns a new String object, everytime it has been called. That is why the actual checking here is between the reference returned by two b.toString(), which are different.