well
String literals represent objects that r placed in the string pool and r destroyed only when the JVM unloads a
java application.
So my question is if we have a question on garbage collection containing string literals then can we say that the string literals r eligible for garbage collection because consider this
String s="Mohit";
s=null;
.
.
String str="Mohit";
well although the reference s is set to null the string literal can still be assigned to another reference variable until the JVM unloads the application and destroys the string pool.