String constant Pool
814889Dec 23 2011 — edited Dec 26 2011HI ,
I have doubt about string constant pool , i want to understand it .As far as i know string maintains a pool where if a new string is created for the same string which is already created then new object will not be created instead it will point to same memory adddress.
String a = new String("aa");
String b ="aa";
String c="aa";
do all three references a,b,c all refer to same object?
and also if string are immutable then below code generated new stirng object or what does it do?
a=a+b;