Qus:    What is String Builder? Which one Preferable string or String Builder?
Nov 20, 2020 13:20 2 Answers Views: 100 FRAUSKY

To avoid string replacing, appending, removing or inserting new strings in the initial string, StringBuilder was introduced. StringBuilder is a dynamic object. It doesn’t create a new object in the memory but dynamically expands the needed memory to accommodate the modified or new string.



StringBuilder is preferred since it performs faster than string in case we are modifying the string by appending string values.

Prev Next
Answers (2)
DIVYA Nov 21, 2020 08:24
Answer:   String Builder is a dynamic object. Its allow number of characters in string. Its does not create a new object in memory.
StringBuilder sb = new StringBuilder(“Hi Team!!”);
We can prefer StringBuilder. Beacuse it performs faster than string when appending multiple string values.

PARTH Nov 23, 2020 09:09
Answer:   To avoid string replacing, appending, removing or inserting new strings in the initial string, StringBuilder was introduced. StringBuilder is a dynamic object. It doesn’t create a new object in the memory but dynamically expands the needed memory to accommodate the modified or new string.

StringBuilder is preferred since it performs faster than string in case we are modifying the string by appending string values.

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