user10137999 wrote:Then that isn't a good example to work with. You're going to get all mixed up with the string pool and the question of whether string literals are created by the compiler. The question of objects created as part of the internal implementation of the String and StringBuffer arises as well.
I wanted to know how object is garbage collected.
If this question looks home work for you, practice and tell me.I don't need the practice thanks. It is you who needs the practice, in asking questions that are going to get answers.
Other wise let others give answers.I'm not stopping anyone from giving answers. I couldn't if I wanted to. I'm just telling you what you're going to get on this forum, from long experience. The concensus here has always been that is pointless for anybody to just give you the answer. The point of the homework is the thought process, and it has to be started by you. You have to learn it for yourself. You can't just keep asking on forums for the rest of your working life. I learnt IT many years before there were any forums at all, so it is quite possible.
EJP wrote:Ah the good old days where people actually made an effort and were happy to do so. A dying breed.
I learnt IT many years before there were any forums at all, so it is quite possible.