Difference Between String , StringBuilder And StringBuffer Classes
String
String is immutable ( as soon as created can not be changed )item . The item created as a
String is saved inside the constant string pool.
Each immutable object in java is thread secure ,that means string is also thread safe . String
Cannot be...
·2 min read·preetimath.hashnode.devRead the article
Shai Almog
When you do
String s = "A" + otherString;javac produces
StringBuilderunder the hood. Prior to JDK 1.5 it producedStringBufferwhich was a major source of performance overhead in Java.