There is some object which is free by out Program e.g String str= "TestString"; str=null;
But still reffer by the Litral Pool
till Poll hase reffrance to String "TestString"
Doubt 1: Behavior is JVM's internally so can it eligible for GC because there is no user define reference to this object only JVM's (As pool reference is there) reference is there can it is eligible for GC
Doubt 2: I Believe that JAVA Literal pool manages there own memory for the pooled literal and there is no link between the Pool�s Object Address and Heap Object Address Reason : when you create String with new operator as String str = �TestString� It will create two object one in Heap Area and one in Pool Area (Reff.: Creating New Strings Ch 6: Kathy Sierra, Page No-410)
Pinkal Patel<br />SCJP 1.5<br />Preparing for SCWCD
One thing to keep in mind is that the real Sun exam will NOT mix GC in with the concept of a literal pool. So, whenever the exam asks you about objects that might or might not be eligible for the GC, those objects WON'T be of a type that might use a literal pool.
I know a lot of mock exams might mix these two concepts together, but the real exam won't.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
If the value p being boxed is true, false, a byte, a char in the range \u0000 to \u007f, or an int or short number between -128 and 127, then let r1 and r2 be the results of any two boxing conversions of p. It is always the case that r1 == r2.