[ajug-members] creating strings

Sony Antony sony.antony at gmail.com
Sat Jul 21 22:54:34 EDT 2007


Is there any different between teh following string instantiations at
run time ( memory, speed of execution etc. )

String s = new String( "XXX") ;

String s = "XXX" ;


I thought they are both exactly same as new strings are created only
if there isn't already an entry in the string table for the same
string.


--sony



More information about the ajug-members mailing list