This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
if instead you make: SetExample s2=s1; your output will be: 1
EDITED but, even using your code with that equals(), output still is 2, because those two String Objects are in fact two diferent objects (diferent memory locations, i guess) anyway i think Equals() is incomplete [ August 13, 2006: Message edited by: miguel lisboa ]