String, StringBuffer,StringBuilder对比

1. Variability

String immutable
StringBuffer and StringBuilder variable
2. Thread Safety

String immutable and therefore thread-safe
StringBuilder is not thread safe
StringBuffer is thread-safe, internally synchronized to synchronize

Published 28 original articles · won praise 24 · views 10000 +

Guess you like

Origin blog.csdn.net/XM_no_homework/article/details/103872775