Hello there, I could see many mock exams has questions on String objects elligible for GC In my undestanding JVM holds a String pool which contain the string objects and we are never sure that this be garbage collected most of the time it will not. please correct if am wrong regs Vivek Nidhi
This is always a point of confusion. I think that perhaps on older versions of the SCJP exam there may have been questions concerning GC and String objects. Because of this, many, many mocks include questions relating the two. For the SCJP 1.4 exam there are two related, but separate topics that are given a LOT of weight: 1 - The immutability of objects of type String. 2 - When do objects, not of type String, become eligible for GC. Hope that helps, Bert
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)