I've taken it as my personal mission lately to try to make people understand that the String pool is not a special area of memory. String literals, like all Strings and all other objects, are in the Java heap. The String pool is a set of unique String references, used to avoid making duplicate copies of literals. Picture it like a HashSet<String> . The Strings are not in the pool -- just references to them are.
Or WeakHashSet<String>, if such a thing existed. But anyone familiar with WeakHashMap ought to be able to infer what I mean, even though Sun didn't deign to fill that particular niche for us. Oh well, no big deal.
More to the point, I'd also want to remind people that you WILL NOT get questions on the actual SCJP exam that depend on understnading of the string pool. You may see mock exams that (inadvertently) deal with it, but if you are at all confused, and if you're just interested in passing the exam, you should probably just ignore such questions.
On the other hand, if you want to discuss the string pool further, regardless of the SCJP, Java in General (Intermediate) would be a good place. It's a complex issue, and many SCJP candidates seem to be better off not worrying about it. Additionally it's pretty rare that this issue is important for working programmers. Usually you just use equals() rather than ==, and it doesn't matter whether a given string has been pooled or not.
I fully approve of anyone wishing to understand this issue better, but the SCJP forum is not the best place for it. [ March 10, 2006: Message edited by: Jim Yingst ]
"I'm not back." - Bill Harding, Twister
You have to be odd to be #1 - Seuss. An odd little ad:
a bit of art, as a gift, that will fit in a stocking