employer cover photo

Distinct Infotech Solutions

Is this your company?

Distinct Infotech Solutions interview question

what are the differences between string and StringBuilder ?

Interview Answer

Anonymous

Feb 16, 2022

String is immutable, Immutable means if you create string object then you cannot modify it and It always create new object of string type in memory. StringBuilder is mutable, means if create string builder object then you can perform any operation like insert, replace or append without creating new instance for every time.it will update string at one place in memory doesnt create new space in memory