Capgemini Interview Question

difference between string & string builder.

Interview Answer

Anonymous

Nov 30, 2018

String is immutable ie, if you try to update it than it will create a new object. Its not thread safe too. String builder is used for updating a string throughout. Its mutable and if you are using single thread than its preferable.