Posted By:
Chandra_Patni
Posted On:
Wednesday, December 29, 2004 12:41 PM
String object "aaa" is eligible for GC. However, if string "aaa" already interned (due to a completely unrelated side effect), then s will be pointing to the already interned "aaa" object. So, line 5 will not have created a new string object. This is no loss no gain scenario.