When a lot of changes are required in data, which one should be a preference to be used? String or StringBuffer?

By drakula david in 22 Sep 2023 | 11:29 am
drakula david

drakula david

Student
Posts: 128
Member since: 22 Sep 2023

When a lot of changes are required in data, which one should be a preference to be used? String or StringBuffer?

22 Sep 2023 | 11:29 am
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023

   - When many changes are required in data, `StringBuffer` should be preferred over `String`. `StringBuffer` is mutable, allowing you to modify its content efficiently, while `String` is immutable, requiring the creation of new objects for each change.


23 Sep 2023 | 04:26 pm
0 Likes

Report

Please describe about the report short and clearly.