Qus:    Difference between String and StringBuilder?
Dec 15, 2020 09:56 2 Answers Views: 702 PADMAKEECHU

A string is immutable means you cannot change it after it was created. Any operation that appears to change the string instead returns a new instance whereas when you need a mutable string, such as where you need to change lots of things, you use a StringBuilder which is a buffer of characters that can be changed.

Prev Next
Answers (2)
PARTH Dec 16, 2020 07:23
Answer:   A string is immutable means you cannot change it after it was created. Any operation that appears to change the string instead returns a new instance whereas when you need a mutable string, such as where you need to change lots of things, you use a StringBuilder which is a buffer of characters that can be changed.

DIVYA Dec 16, 2020 13:00
Answer:   String is an immutable object and StringBuilder is a Mutable Object. Performance wise string is slow because its’ create a new instance to override or change the previous value.

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect