From RHE, 2nd Edition, page 256:
"Every string literal is represented internally by an instance of String.
Java classes may have a pool of such strings. When a literal is compiled, the compiler adds an appropriate string to the pool. However, if the same literal already appeared as a literal elsewhere in the class, then it is already represented in the pool. The compiler does not create a new copy; instead, it uses the existing one from the pool."
So references to the string literals are maintained by the pool and so those literals would not become eligible for garbage collection.
April
[This message has been edited by April.Johnson (edited July 26, 2001).]