Skip to content

Latest commit

 

History

History
7 lines (6 loc) · 259 Bytes

File metadata and controls

7 lines (6 loc) · 259 Bytes

StringBuild 和 StringBuffer有什么区别?

Answer

StringBuffer的方法是synchronized的, 而StringBuild不是。 除非你真的要在多个线程中使用同一个String, 在单线程环境中优先使用StringBuild,它快一点。