I have gone through this String Constant Pool Java but dint get any clarity I want to know how many objects are created i.e memory space allocated when
String s=new String("stackoverflow");
Are 2 object created if stackoverflow is not available in string constant pool i.e one in string constant pool and the other in heap memory and s will be pointing to the one in heap memory..? or
Only one object is created in heap memory...?