Here when we make the reference s1 to null, whether the String object referenced by the literal namely "SCJP1.4" is eligible for garbage collection.
I read like literal itself a reference to String object and that when you try to assign the literal to String reference,the reference will be pointing to String object. So when s1 is made null. The literal referring to String object will be exisiting.
In this case, s2 is eligible for garbage collection after line 4 is executed. this is because String object (in the string pool) with value "SCWCD1.4" is unreachable
This is what I feel , Objects in the String Pool will not be GC'd. also in the above case s2 is not at all set to null. So none of the objects will be eligibe for GC [ December 19, 2005: Message edited by: Srinivasa Raghavan ]