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.
only 1. str1 is just a string ref variable and not an object. thanks, deep
Joined: Aug 24, 2003
Hmmm.......... Shouldn't it be 3 objects? str1 will be given a default value as null, so there is a null object created. strExample has a String object "Hi" created and passed to the new constructor to created another String object that assigned to strExample later. So two object has been created. I just can't sure whether the null one should be counted or not. Regards Anthony Yip