Pergunta de entrevista da empresa Distinct Infotech Solutions

what are the differences between string and StringBuilder ?

Resposta da entrevista

Sigiloso

16 de fev. de 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