Are string literals eligible for GC?
The objects created in the String pool are not subjected to GC until the class is unloaded by the JVM. They get discarded at that time or just before the virtual machine unloads the class’ bytecode. For the purpose of the SCJP exam, you are not required to know the details of String pool memory management.