Feature | String | StringBuilder | StringBuffer |
|---|---|---|---|
Mutable | No | Yes | Yes |
Thread-safe | Immutable | No | Yes, synchronized methods |
Performance for repeated changes | Poor | Fast | Slower than StringBuilder |
Loading…
Feature | String | StringBuilder | StringBuffer |
|---|---|---|---|
Mutable | No | Yes | Yes |
Thread-safe | Immutable | No | Yes, synchronized methods |
Performance for repeated changes | Poor | Fast | Slower than StringBuilder |