Difference between StringBuffer and StringBuilder

Опубликовано: 28 Сентябрь 2024
на канале: Java code&Decode
63
6

Difference between StringBuffer and StringBuilder
StringBuffer StringBuilder
From JDK 1.0 From JDK 1.5
The storage area is heap and modified easily. Storage is heap and can be modified.
StringBuffer is thread-safe. StringBuilder is fast as it is not thread-safe.
The performance is very slow. The performance is very fast.
StringBuffer methods are synchronized StringBuilder is non-synchronized.