Sollicitatievraag bij Capgemini

difference between string & string builder.

Antwoord op sollicitatievraag

Anoniem

30 nov 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.