September 10, 2008 at 11:42 AM
this.text = text : In this case text will go pool area and this.text refer it.
this.text = new String(text):
In this Case Java will create a new String object
in normal (non-pool) memory, and this.text will refer to it. In addition, the literal text will be placed in the pool.
Refer SCJP Book Chapter6
September 10, 2008 at 12:28 PM
Thank you very much.
One more thing please, how can I get a variable pointer to see where it points to?