Understanding Object Creation in Java: How Many Objects Are Created by `String s = new String("xyz")`?
This article explains the evolution of the Java method area, analyzes bytecode generated by `String s = new String("xyz")` and `String s = "xyz"`, and clarifies why the expression creates one or two objects depending on whether the literal already exists in the constant pool.
