How Many Objects Does new String("abc") Actually Create?
This article explains why the interview question "String str = new String(\"abc\")" can create either one or two objects depending on JVM string pool state, detailing the JVM memory model, string pool mechanics, code examples, best practices, and common misconceptions.
