Why Does new String("abc") Create One or Two Objects in Java?
Creating a String with new String("abc") can generate either one or two objects depending on whether the literal "abc" already exists in the JVM’s string constant pool, affecting object placement in the pool versus the heap and influencing reference equality comparisons.
