Hi i am working in java and want to know how String objects are created in the String pool and how they are managed.
So in the following example i am creating two Strings s and s1,so can anyone explain me how many Objects are created in LIne1?Also how many Objects are eligible for garbage collection in Line3?
String s = "x" + "y";//Line 1
String s1 = s;//Line 2
s = null;//Line 3